diff options
Diffstat (limited to 'sys/mips/include/_stdint.h')
-rw-r--r-- | sys/mips/include/_stdint.h | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/sys/mips/include/_stdint.h b/sys/mips/include/_stdint.h index 2a5a0dc6..7178007 100644 --- a/sys/mips/include/_stdint.h +++ b/sys/mips/include/_stdint.h @@ -46,28 +46,21 @@ #define INT8_C(c) (c) #define INT16_C(c) (c) #define INT32_C(c) (c) -#ifdef __mips_n64 -#define INT64_C(c) (c ## L) -#else -#define INT64_C(c) (c ## LL) -#endif #define UINT8_C(c) (c) #define UINT16_C(c) (c) #define UINT32_C(c) (c ## U) -#ifdef __mips_n64 + +#ifdef __LP64__ +#define INT64_C(c) (c ## L) #define UINT64_C(c) (c ## UL) #else +#define INT64_C(c) (c ## LL) #define UINT64_C(c) (c ## ULL) #endif -#ifdef __mips_n64 -#define INTMAX_C(c) (c ## L) -#define UINTMAX_C(c) (c ## UL) -#else -#define INTMAX_C(c) (c ## LL) -#define UINTMAX_C(c) (c ## ULL) -#endif +#define INTMAX_C(c) INT64_C(c) +#define UINTMAX_C(c) UINT64_C(c) #endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ @@ -81,19 +74,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INTMAX_C(0x7fffffffffffffff)-1) +#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX INTMAX_C(0x7fffffffffffffff) +#define INT64_MAX INT64_C(0x7fffffffffffffff) /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff -#define UINT32_MAX 0xffffffffU -#define UINT64_MAX UINTMAX_C(0xffffffffffffffff) +#define UINT32_MAX 0xffffffff +#define UINT64_MAX UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 @@ -143,7 +136,7 @@ * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ -#ifdef __mips_n64 +#ifdef __LP64__ #define INTPTR_MIN INT64_MIN #define INTPTR_MAX INT64_MAX #define UINTPTR_MAX UINT64_MAX @@ -165,26 +158,26 @@ * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ +#ifdef __LP64__ /* Limits of ptrdiff_t. */ -#ifdef __mips_n64 #define PTRDIFF_MIN INT64_MIN #define PTRDIFF_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 + +/* Limit of size_t. */ +#define SIZE_MAX UINT32_MAX #endif /* Limits of sig_atomic_t. */ #define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MAX INT32_MAX -/* Limit of size_t. */ -#ifdef __mips_n64 -#define SIZE_MAX UINT64_MAX -#else -#define SIZE_MAX UINT32_MAX -#endif - #ifndef WCHAR_MIN /* Also possibly defined in <wchar.h> */ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN |