diff options
Diffstat (limited to 'sys/powerpc/include/_stdint.h')
-rw-r--r-- | sys/powerpc/include/_stdint.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/sys/powerpc/include/_stdint.h b/sys/powerpc/include/_stdint.h index 0d8aedf..ad0d87e 100644 --- a/sys/powerpc/include/_stdint.h +++ b/sys/powerpc/include/_stdint.h @@ -45,15 +45,22 @@ #define INT8_C(c) (c) #define INT16_C(c) (c) #define INT32_C(c) (c) -#define INT64_C(c) (c ## LL) #define UINT8_C(c) (c) #define UINT16_C(c) (c) #define UINT32_C(c) (c ## U) -#define UINT64_C(c) (c ## ULL) +#ifdef __powerpc64__ +#define INT64_C(c) (c ## L) +#define UINT64_C(c) (c ## UL) +#define INTMAX_C(c) (c ## L) +#define UINTMAX_C(c) (c ## UL) +#else +#define INT64_C(c) (c ## LL) +#define UINT64_C(c) (c ## ULL) #define INTMAX_C(c) (c ## LL) #define UINTMAX_C(c) (c ## ULL) +#endif #endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ @@ -73,13 +80,21 @@ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff +#ifdef __powerpc64__ +#define INT64_MAX 0x7fffffffffffffffL +#else #define INT64_MAX 0x7fffffffffffffffLL +#endif /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffffU +#ifdef __powerpc64__ +#define UINT64_MAX 0xffffffffffffffffUL +#else #define UINT64_MAX 0xffffffffffffffffULL +#endif /* * ISO/IEC 9899:1999 @@ -129,9 +144,15 @@ * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ +#ifdef __powerpc64__ +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else #define INTPTR_MIN INT32_MIN #define INTPTR_MAX INT32_MAX #define UINTPTR_MAX UINT32_MAX +#endif /* * ISO/IEC 9899:1999 @@ -145,6 +166,18 @@ * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ +#ifdef __powerpc64__ +/* Limits of ptrdiff_t. */ +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX + +/* Limits of sig_atomic_t. */ +#define SIG_ATOMIC_MIN INT64_MIN +#define SIG_ATOMIC_MAX INT64_MAX + +/* Limit of size_t. */ +#define SIZE_MAX UINT64_MAX +#else /* Limits of ptrdiff_t. */ #define PTRDIFF_MIN INT32_MIN #define PTRDIFF_MAX INT32_MAX @@ -155,6 +188,7 @@ /* Limit of size_t. */ #define SIZE_MAX UINT32_MAX +#endif #ifndef WCHAR_MIN /* Also possibly defined in <wchar.h> */ /* Limits of wchar_t. */ |