diff options
Diffstat (limited to 'include/typemax.h')
-rw-r--r-- | include/typemax.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/typemax.h b/include/typemax.h index 32e7a89..300b113 100644 --- a/include/typemax.h +++ b/include/typemax.h @@ -77,6 +77,21 @@ static const unsigned long long int maxquad = ULLONG_MAX; # define ULLONG_MAX maxquad #endif +#if !defined (INTMAX_MAX) || !defined (INTMAX_MIN) + +#if SIZEOF_INTMAX_T == SIZEOF_LONG_LONG +# define INTMAX_MAX LLONG_MAX +# define INTMAX_MIN LLONG_MIN +#elif SIZEOF_INTMAX_T == SIZEOF_LONG +# define INTMAX_MAX LONG_MAX +# define INTMAX_MIN LONG_MIN +#else +# define INTMAX_MAX INT_MAX +# define INTMAX_MIN INT_MIN +#endif + +#endif + #ifndef SSIZE_MAX # define SSIZE_MAX 32767 /* POSIX minimum max */ #endif |