diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-05-06 12:24:45 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-05-06 12:24:45 +0000 |
commit | 20adc8f2a99cd37b64a80ef63dfc5ba6627d4dfb (patch) | |
tree | ad57ce9ac9538c780c802adbdfc4c581f9100310 /defines.h | |
parent | 343d57711556d429eda777ab259ff924acbd6b34 (diff) |
Notes
Diffstat (limited to 'defines.h')
-rw-r--r-- | defines.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/defines.h b/defines.h index c89f85a8d9c0..f1662edcfea0 100644 --- a/defines.h +++ b/defines.h @@ -328,6 +328,28 @@ typedef unsigned int size_t; #define SIZE_MAX SIZE_T_MAX #endif +#ifndef INT32_MAX +# if (SIZEOF_INT == 4) +# define INT32_MAX INT_MAX +# elif (SIZEOF_LONG == 4) +# define INT32_MAX LONG_MAX +# else +# error "need INT32_MAX" +# endif +#endif + +#ifndef INT64_MAX +# if (SIZEOF_INT == 8) +# define INT64_MAX INT_MAX +# elif (SIZEOF_LONG == 8) +# define INT64_MAX LONG_MAX +# elif (SIZEOF_LONG_LONG_INT == 8) +# define INT64_MAX LLONG_MAX +# else +# error "need INT64_MAX" +# endif +#endif + #ifndef HAVE_SSIZE_T typedef int ssize_t; # define HAVE_SSIZE_T @@ -497,6 +519,13 @@ struct winsize { } #endif +#ifndef timespeccmp +#define timespeccmp(tsp, usp, cmp) \ + (((tsp)->tv_sec == (usp)->tv_sec) ? \ + ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ + ((tsp)->tv_sec cmp (usp)->tv_sec)) +#endif + #ifndef __P # define __P(x) x #endif |