提交 c7af2710 编写于 作者: R Rich Felker

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.
上级 201995f3
#ifndef WCHAR_MIN
#define WCHAR_MIN 0U
#define WCHAR_MAX 0xffffffffU
#endif
#ifndef WCHAR_MIN
#define WCHAR_MIN (-1-0x7fffffff)
#define WCHAR_MAX (0x7fffffff)
#endif
#ifndef WCHAR_MIN
#define WCHAR_MIN (-1-0x7fffffff)
#define WCHAR_MAX (0x7fffffff)
#endif
#ifndef WCHAR_MIN
#define WCHAR_MIN 0U
#define WCHAR_MAX 0xffffffffU
#endif
#ifndef WCHAR_MIN
#define WCHAR_MIN (-1-0x7fffffff)
#define WCHAR_MAX (0x7fffffff)
#endif
#ifndef WCHAR_MIN
#define WCHAR_MIN (-1-0x7fffffff)
#define WCHAR_MAX (0x7fffffff)
#endif
...@@ -78,7 +78,14 @@ typedef unsigned long long uintmax_t; ...@@ -78,7 +78,14 @@ typedef unsigned long long uintmax_t;
#define WINT_MIN INT32_MIN #define WINT_MIN INT32_MIN
#define WINT_MAX INT32_MAX #define WINT_MAX INT32_MAX
#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
#include <bits/stdint.h> #include <bits/stdint.h>
#endif #endif
......
...@@ -24,7 +24,13 @@ extern "C" { ...@@ -24,7 +24,13 @@ extern "C" {
#include <bits/alltypes.h> #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 #define NULL 0L
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册