diff options
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); |
