r319746 - Add __WINT_MAX__.
Ed Schouten via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 5 01:13:18 PST 2017
Author: ed
Date: Tue Dec 5 01:13:18 2017
New Revision: 319746
URL: http://llvm.org/viewvc/llvm-project?rev=319746&view=rev
Log:
Add __WINT_MAX__.
This definition is similar to __WCHAR_MAX__, except that it applies to
wint_t. It's also documented as being supported by GCC 4.5 and later.
Modified:
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/test/Preprocessor/init.c
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=319746&r1=319745&r2=319746&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Tue Dec 5 01:13:18 2017
@@ -751,6 +751,7 @@ static void InitializePredefinedMacros(c
DefineTypeSize("__LONG_MAX__", TargetInfo::SignedLong, TI, Builder);
DefineTypeSize("__LONG_LONG_MAX__", TargetInfo::SignedLongLong, TI, Builder);
DefineTypeSize("__WCHAR_MAX__", TI.getWCharType(), TI, Builder);
+ DefineTypeSize("__WINT_MAX__", TI.getWIntType(), TI, Builder);
DefineTypeSize("__INTMAX_MAX__", TI.getIntMaxType(), TI, Builder);
DefineTypeSize("__SIZE_MAX__", TI.getSizeType(), TI, Builder);
Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=319746&r1=319745&r2=319746&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Tue Dec 5 01:13:18 2017
@@ -1243,6 +1243,7 @@
// AARCH64-FREEBSD:#define __WCHAR_TYPE__ unsigned int
// AARCH64-FREEBSD:#define __WCHAR_UNSIGNED__ 1
// AARCH64-FREEBSD:#define __WCHAR_WIDTH__ 32
+// AARCH64-FREEBSD:#define __WINT_MAX__ 2147483647
// AARCH64-FREEBSD:#define __WINT_TYPE__ int
// AARCH64-FREEBSD:#define __WINT_WIDTH__ 32
// AARCH64-FREEBSD:#define __aarch64__ 1
@@ -8440,6 +8441,7 @@
// X86_64-CLOUDABI:#define __WCHAR_MAX__ 2147483647
// X86_64-CLOUDABI:#define __WCHAR_TYPE__ int
// X86_64-CLOUDABI:#define __WCHAR_WIDTH__ 32
+// X86_64-CLOUDABI:#define __WINT_MAX__ 2147483647
// X86_64-CLOUDABI:#define __WINT_TYPE__ int
// X86_64-CLOUDABI:#define __WINT_WIDTH__ 32
// X86_64-CLOUDABI:#define __amd64 1
@@ -9364,6 +9366,7 @@
// WEBASSEMBLY32-NEXT:#define __WCHAR_TYPE__ int
// WEBASSEMBLY32-NOT:#define __WCHAR_UNSIGNED__
// WEBASSEMBLY32-NEXT:#define __WCHAR_WIDTH__ 32
+// WEBASSEMBLY32-NEXT:#define __WINT_MAX__ 2147483647
// WEBASSEMBLY32-NEXT:#define __WINT_TYPE__ int
// WEBASSEMBLY32-NOT:#define __WINT_UNSIGNED__
// WEBASSEMBLY32-NEXT:#define __WINT_WIDTH__ 32
@@ -9695,6 +9698,7 @@
// WEBASSEMBLY64-NEXT:#define __WCHAR_TYPE__ int
// WEBASSEMBLY64-NOT:#define __WCHAR_UNSIGNED__
// WEBASSEMBLY64-NEXT:#define __WCHAR_WIDTH__ 32
+// WEBASSEMBLY64-NEXT:#define __WINT_MAX__ 2147483647
// WEBASSEMBLY64-NEXT:#define __WINT_TYPE__ int
// WEBASSEMBLY64-NOT:#define __WINT_UNSIGNED__
// WEBASSEMBLY64-NEXT:#define __WINT_WIDTH__ 32
More information about the cfe-commits
mailing list