From: Douglas Gregor Date: Fri, 6 Aug 2010 12:37:52 +0000 (+0000) Subject: Define _INTEGRAL_MAX_BITS for the win32 and win64 targets, from Per Lindén! X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72283806e717442536eef55941fd573d4b552393;p=clang Define _INTEGRAL_MAX_BITS for the win32 and win64 targets, from Per Lindén! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110442 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 10395658c1..40a029673e 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1349,6 +1349,7 @@ public: // 300=386, 400=486, 500=Pentium, 600=Blend (default) // We lost the original triple, so we use the default. Builder.defineMacro("_M_IX86", "600"); + Builder.defineMacro("_INTEGRAL_MAX_BITS", "64"); } }; } // end anonymous namespace @@ -1488,6 +1489,7 @@ public: MacroBuilder &Builder) const { WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder); Builder.defineMacro("_M_X64"); + Builder.defineMacro("_INTEGRAL_MAX_BITS", "64"); } }; } // end anonymous namespace diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 4ebaddfa3f..6c27a6c431 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -74,9 +74,10 @@ // C94:#define __STDC_VERSION__ 199409L // // -// RUN: %clang_cc1 -fms-extensions -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s +// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s // // MSEXT-NOT:#define __STDC__ +// MSEXT:#define _INTEGRAL_MAX_BITS 64 // MSEXT:#define __int16 __INT16_TYPE__ // MSEXT:#define __int32 __INT32_TYPE__ // MSEXT:#define __int64 __INT64_TYPE__