diff options
Diffstat (limited to 'defines.h')
-rw-r--r-- | defines.h | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -328,6 +328,28 @@ typedef unsigned int size_t; | |||
328 | #define SIZE_MAX SIZE_T_MAX | 328 | #define SIZE_MAX SIZE_T_MAX |
329 | #endif | 329 | #endif |
330 | 330 | ||
331 | #ifndef INT32_MAX | ||
332 | # if (SIZEOF_INT == 4) | ||
333 | # define INT32_MAX INT_MAX | ||
334 | # elif (SIZEOF_LONG == 4) | ||
335 | # define INT32_MAX LONG_MAX | ||
336 | # else | ||
337 | # error "need INT32_MAX" | ||
338 | # endif | ||
339 | #endif | ||
340 | |||
341 | #ifndef INT64_MAX | ||
342 | # if (SIZEOF_INT == 8) | ||
343 | # define INT64_MAX INT_MAX | ||
344 | # elif (SIZEOF_LONG == 8) | ||
345 | # define INT64_MAX LONG_MAX | ||
346 | # elif (SIZEOF_LONG_LONG_INT == 8) | ||
347 | # define INT64_MAX LLONG_MAX | ||
348 | # else | ||
349 | # error "need INT64_MAX" | ||
350 | # endif | ||
351 | #endif | ||
352 | |||
331 | #ifndef HAVE_SSIZE_T | 353 | #ifndef HAVE_SSIZE_T |
332 | typedef int ssize_t; | 354 | typedef int ssize_t; |
333 | # define HAVE_SSIZE_T | 355 | # define HAVE_SSIZE_T |
@@ -497,6 +519,13 @@ struct winsize { | |||
497 | } | 519 | } |
498 | #endif | 520 | #endif |
499 | 521 | ||
522 | #ifndef timespeccmp | ||
523 | #define timespeccmp(tsp, usp, cmp) \ | ||
524 | (((tsp)->tv_sec == (usp)->tv_sec) ? \ | ||
525 | ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ | ||
526 | ((tsp)->tv_sec cmp (usp)->tv_sec)) | ||
527 | #endif | ||
528 | |||
500 | #ifndef __P | 529 | #ifndef __P |
501 | # define __P(x) x | 530 | # define __P(x) x |
502 | #endif | 531 | #endif |