diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-04-04 19:57:23 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-04-04 19:57:23 -0400 |
commit | c7af2710007865861e789b29e803f0f55deba93f (patch) | |
tree | 6cbf4186d689a0bafc85b2f9d4d63b581bb2f266 /include/wchar.h | |
parent | 201995f382cc698ae19289623cc06a70048ffe7b (diff) | |
download | musl-c7af2710007865861e789b29e803f0f55deba93f.tar.gz musl-c7af2710007865861e789b29e803f0f55deba93f.tar.bz2 musl-c7af2710007865861e789b29e803f0f55deba93f.tar.xz musl-c7af2710007865861e789b29e803f0f55deba93f.zip |
eliminate bits/wchar.h
the preprocessor can reliably determine the signedness of wchar_t.
L'\0' is used for 0 in the expressions so that, if the underlying type
of wchar_t is long rather than int, the promoted type of the
expression will match the type of wchar_t.
Diffstat (limited to 'include/wchar.h')
-rw-r--r-- | include/wchar.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/wchar.h b/include/wchar.h index 9ceddd57..d8738818 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -24,7 +24,13 @@ extern "C" { #include <bits/alltypes.h> -#include <bits/wchar.h> +#if L'\0'-1 > 0 +#define WCHAR_MAX (0xffffffffu+L'\0') +#define WCHAR_MIN (0+L'\0') +#else +#define WCHAR_MAX (0x7fffffff+L'\0') +#define WCHAR_MIN (-1-0x7fffffff+L'\0') +#endif #define NULL 0L |