diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2012-03-10 22:21:14 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2012-03-10 22:21:14 +0000 |
commit | 5b31d55ab3a72c026a0781b6dcf9bc1dd462e8b9 (patch) | |
tree | 3c85cdb6fa653a283ca2f528d1cddaf363e2edfc /lib/Frontend | |
parent | bccda480f424c001a14e0fb84910f20f31f5fcfb (diff) |
No longer defining GNUC mode when compiling for Microsoft compatibility. This allows people's cross-platform compiler-specific macros to work properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 2052a3a6b1..2caab7c5dd 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -319,11 +319,14 @@ static void InitializePredefinedMacros(const TargetInfo &TI, + getClangFullRepositoryVersion() + ")\""); #undef TOSTR #undef TOSTR2 - // Currently claim to be compatible with GCC 4.2.1-5621. - Builder.defineMacro("__GNUC_MINOR__", "2"); - Builder.defineMacro("__GNUC_PATCHLEVEL__", "1"); - Builder.defineMacro("__GNUC__", "4"); - Builder.defineMacro("__GXX_ABI_VERSION", "1002"); + if (!LangOpts.MicrosoftMode) { + // Currently claim to be compatible with GCC 4.2.1-5621, but only if we're + // not compiling for MSVC compatibility + Builder.defineMacro("__GNUC_MINOR__", "2"); + Builder.defineMacro("__GNUC_PATCHLEVEL__", "1"); + Builder.defineMacro("__GNUC__", "4"); + Builder.defineMacro("__GXX_ABI_VERSION", "1002"); + } // Define macros for the C11 / C++11 memory orderings Builder.defineMacro("__ATOMIC_RELAXED", "0"); |