diff options
| author | Elliott Hughes <enh@google.com> | 2013-06-13 16:02:53 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2013-06-13 16:02:53 -0700 |
| commit | 7c89506e3af3ee97691a98329f0d7b5edef49218 (patch) | |
| tree | eedba0ee4b14ca207e63bc8aaf3f25c4a84912ae /libc | |
| parent | c843a3e7b215bca5e896e1d56c2fa6332770ea83 (diff) | |
| download | bionic-7c89506e3af3ee97691a98329f0d7b5edef49218.zip bionic-7c89506e3af3ee97691a98329f0d7b5edef49218.tar.gz bionic-7c89506e3af3ee97691a98329f0d7b5edef49218.tar.bz2 | |
Ensure that <stdint.h> defines SIZE_MAX and friends.
We were missing SIG_ATOMIC_MAX, SIG_ATOMIC_MIN, SIZE_MAX,
WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.
Change-Id: I2535f36bc220fbaea009b483599b7af811c4cb5c
Diffstat (limited to 'libc')
| -rw-r--r-- | libc/include/stdint.h | 20 | ||||
| -rw-r--r-- | libc/include/wchar.h | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/libc/include/stdint.h b/libc/include/stdint.h index 222ff1b..293fb03 100644 --- a/libc/include/stdint.h +++ b/libc/include/stdint.h @@ -30,7 +30,6 @@ #include <stddef.h> #include <sys/_types.h> -#include <machine/limits.h> /* For SIZE_MAX. */ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) # define __STDINT_LIMITS @@ -227,6 +226,25 @@ typedef int64_t intmax_t; # define UINTMAX_C(c) UINT64_C(c) #endif +/* + * sig_atomic_t, size_t, wchar_t, and wint_t. + */ + +#ifdef __STDINT_LIMITS +# define SIG_ATOMIC_MAX INT32_MAX +# define SIG_ATOMIC_MIN INT32_MIN + +# define SIZE_MAX UINT32_MAX + +# ifndef WCHAR_MAX /* These might also have been defined by <wchar.h>. */ +# define WCHAR_MAX INT32_MAX +# define WCHAR_MIN INT32_MIN +# endif + +# define WINT_MAX INT32_MAX +# define WINT_MIN INT32_MIN +#endif + #define _BITSIZE 32 /* Keep the kernel from trying to define these types... */ diff --git a/libc/include/wchar.h b/libc/include/wchar.h index a4e19f0..76ac02c 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -65,8 +65,11 @@ typedef enum { WC_TYPE_MAX } wctype_t; +#ifndef WCHAR_MAX #define WCHAR_MAX INT_MAX #define WCHAR_MIN INT_MIN +#endif + #define WEOF ((wint_t)(-1)) extern wint_t btowc(int); |
