]> granicus.if.org Git - clang/commitdiff
Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary
authorKen Dyck <ken.dyck@onsemi.com>
Thu, 19 Nov 2009 14:35:19 +0000 (14:35 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Thu, 19 Nov 2009 14:35:19 +0000 (14:35 +0000)
widths. This corrects the values of these definitions for MSP430 and PIC16.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89350 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/stdint.h
test/Preprocessor/stdint.c

index b95ae8fb42b2183e40ad8271d0c5d3da9379092c..a25f8f52aaca6aa44608cce8055f769c2384d4ad 100644 (file)
@@ -618,8 +618,8 @@ typedef __stdint_exjoin3(uint, __INTMAX_WIDTH__, _t) uintmax_t;
 /* C99 7.18.3 Limits of other integer types. */
 #define SIG_ATOMIC_MIN INT32_MIN
 #define SIG_ATOMIC_MAX INT32_MAX
-#define WINT_MIN       INT32_MIN
-#define WINT_MAX       INT32_MAX
+#define WINT_MIN       __stdint_exjoin3(INT, __WINT_WIDTH__, _MIN)
+#define WINT_MAX       __stdint_exjoin3(INT, __WINT_WIDTH__, _MAX)
 
 /* FIXME: if we ever support a target with unsigned wchar_t, this should be
  * 0 .. Max.
index 9c98e291664c4616b2600a8108cff292acddd5b3..ed8e9a0624933651f36a4833a90776fcba562cd7 100644 (file)
 //
 // MSP430:SIG_ATOMIC_MIN_ (-2147483647L -1)
 // MSP430:SIG_ATOMIC_MAX_ 2147483647L
-// MSP430:WINT_MIN_ (-2147483647L -1)
-// MSP430:WINT_MAX_ 2147483647L
+// MSP430:WINT_MIN_ (-32767 -1)
+// MSP430:WINT_MAX_ 32767
 //
 // MSP430:WCHAR_MAX_ 32767
 // MSP430:WCHAR_MIN_ (-32767 -1)
 //
 // PIC16:SIG_ATOMIC_MIN_ (-2147483647L -1)
 // PIC16:SIG_ATOMIC_MAX_ 2147483647L
-// PIC16:WINT_MIN_ (-2147483647L -1)
-// PIC16:WINT_MAX_ 2147483647L
+// PIC16:WINT_MIN_ (-32767 -1)
+// PIC16:WINT_MAX_ 32767
 //
 // PIC16:WCHAR_MAX_ 32767
 // PIC16:WCHAR_MIN_ (-32767 -1)