From e3b1ac14bdd0ec3340d7274017692268a4f61df0 Mon Sep 17 00:00:00 2001 From: Sergey Melnikov Date: Mon, 26 Nov 2012 18:02:30 +0400 Subject: [PATCH] stdint.h header is not fully compatible with C99(ISO9899:1999) 1. stdint.h doesn't provide macros: * SIG_ATOMIC_MIN * SIG_ATOMIC_MAX * WCHAR_MIN * WCHAR_MAX * WINT_MIN * WINT_MAX 2. stdint.h provides macros with incorrect type: * UINT8_C * UINT16_C * UINT8_MAX * UINT16_MAX Change-Id: I3f4da907eaee8f46d8eb956950230ca2eb04a3ea Signed-off-by: Sergey Melnikov --- ndk/platforms/android-3/include/stdint.h | 35 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/ndk/platforms/android-3/include/stdint.h b/ndk/platforms/android-3/include/stdint.h index c3e29dde7..54ea026d5 100644 --- a/ndk/platforms/android-3/include/stdint.h +++ b/ndk/platforms/android-3/include/stdint.h @@ -66,7 +66,7 @@ typedef uint8_t uint_fast8_t; # define INT_FAST8_MIN INT8_MIN # define INT_FAST8_MAX INT8_MAX -# define UINT8_MAX (255U) +# define UINT8_MAX (255) # define UINT_LEAST8_MAX UINT8_MAX # define UINT_FAST8_MAX UINT8_MAX #endif @@ -76,7 +76,7 @@ typedef uint8_t uint_fast8_t; # define INT_LEAST8_C(c) INT8_C(c) # define INT_FAST8_C(c) INT8_C(c) -# define UINT8_C(c) c ## U +# define UINT8_C(c) c # define UINT_LEAST8_C(c) UINT8_C(c) # define UINT_FAST8_C(c) UINT8_C(c) #endif @@ -99,7 +99,7 @@ typedef uint32_t uint_fast16_t; # define INT_FAST16_MIN INT32_MIN # define INT_FAST16_MAX INT32_MAX -# define UINT16_MAX (65535U) +# define UINT16_MAX (65535) # define UINT_LEAST16_MAX UINT16_MAX # define UINT_FAST16_MAX UINT32_MAX #endif @@ -109,7 +109,7 @@ typedef uint32_t uint_fast16_t; # define INT_LEAST16_C(c) INT16_C(c) # define INT_FAST16_C(c) INT32_C(c) -# define UINT16_C(c) c ## U +# define UINT16_C(c) c # define UINT_LEAST16_C(c) UINT16_C(c) # define UINT_FAST16_C(c) UINT32_C(c) #endif @@ -226,6 +226,33 @@ typedef int64_t intmax_t; # define UINTMAX_C(c) UINT64_C(c) #endif +/* Limits of sig_atomic_t. */ +#ifdef __STDINT_LIMITS +# define SIG_ATOMIC_MIN INT32_MIN +# define SIG_ATOMIC_MAX INT32_MAX +#endif + +/* Limits of wchar_t. */ +#ifdef __STDINT_LIMITS + /* Also possibly defined in */ +# ifndef WCHAR_MIN +# define WCHAR_MIN INT32_MIN +# define WCHAR_MAX INT32_MAX +# endif +#endif + +/* Limits of wint_t. */ +#ifdef __STDINT_LIMITS +# define WINT_MIN INT32_MIN +# define WINT_MAX INT32_MAX +#endif + +/* size_t is defined by the GCC-specific */ +#ifndef _SSIZE_T_DEFINED_ +#define _SSIZE_T_DEFINED_ +typedef long int ssize_t; +#endif + #define _BITSIZE 32 /* Keep the kernel from trying to define these types... */