summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/bits/wchar.h4
-rw-r--r--arch/i386/bits/wchar.h4
-rw-r--r--arch/microblaze/bits/wchar.h4
-rw-r--r--arch/mips/bits/wchar.h4
-rw-r--r--arch/powerpc/bits/wchar.h4
-rw-r--r--arch/x86_64/bits/wchar.h4
-rw-r--r--include/stdint.h9
-rw-r--r--include/wchar.h8
8 files changed, 15 insertions, 26 deletions
diff --git a/arch/arm/bits/wchar.h b/arch/arm/bits/wchar.h
deleted file mode 100644
index ffb26917..00000000
--- a/arch/arm/bits/wchar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WCHAR_MIN
-#define WCHAR_MIN 0U
-#define WCHAR_MAX 0xffffffffU
-#endif
diff --git a/arch/i386/bits/wchar.h b/arch/i386/bits/wchar.h
deleted file mode 100644
index c969c5b6..00000000
--- a/arch/i386/bits/wchar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WCHAR_MIN
-#define WCHAR_MIN (-1-0x7fffffff)
-#define WCHAR_MAX (0x7fffffff)
-#endif
diff --git a/arch/microblaze/bits/wchar.h b/arch/microblaze/bits/wchar.h
deleted file mode 100644
index c969c5b6..00000000
--- a/arch/microblaze/bits/wchar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WCHAR_MIN
-#define WCHAR_MIN (-1-0x7fffffff)
-#define WCHAR_MAX (0x7fffffff)
-#endif
diff --git a/arch/mips/bits/wchar.h b/arch/mips/bits/wchar.h
deleted file mode 100644
index ffb26917..00000000
--- a/arch/mips/bits/wchar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WCHAR_MIN
-#define WCHAR_MIN 0U
-#define WCHAR_MAX 0xffffffffU
-#endif
diff --git a/arch/powerpc/bits/wchar.h b/arch/powerpc/bits/wchar.h
deleted file mode 100644
index c969c5b6..00000000
--- a/arch/powerpc/bits/wchar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WCHAR_MIN
-#define WCHAR_MIN (-1-0x7fffffff)
-#define WCHAR_MAX (0x7fffffff)
-#endif
diff --git a/arch/x86_64/bits/wchar.h b/arch/x86_64/bits/wchar.h
deleted file mode 100644
index c969c5b6..00000000
--- a/arch/x86_64/bits/wchar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WCHAR_MIN
-#define WCHAR_MIN (-1-0x7fffffff)
-#define WCHAR_MAX (0x7fffffff)
-#endif
diff --git a/include/stdint.h b/include/stdint.h
index 7ca9d76b..486d1ac2 100644
--- a/include/stdint.h
+++ b/include/stdint.h
@@ -78,7 +78,14 @@ typedef unsigned long long uintmax_t;
#define WINT_MIN INT32_MIN
#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>
#endif
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