Hi hans,
This breaks building the cairo library with MSVC on Windows, because it uses
__STRICT_ANSI__ to detect whether the inline keyword is available.
http://reviews.llvm.org/D4350
Files:
lib/Frontend/InitPreprocessor.cpp
test/Frontend/strict-ansi.c
Index: lib/Frontend/InitPreprocessor.cpp
===================================================================
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -433,7 +433,7 @@
// Initialize language-specific preprocessor defines.
// Standard conforming mode?
- if (!LangOpts.GNUMode)
+ if (!LangOpts.GNUMode && !LangOpts.MSVCCompat)
Builder.defineMacro("__STRICT_ANSI__");
if (LangOpts.CPlusPlus11)
Index: test/Frontend/strict-ansi.c
===================================================================
--- /dev/null
+++ test/Frontend/strict-ansi.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fms-compatibility -verify %s
+// expected-no-diagnostics
+
+#if defined(__STRICT_ANSI__)
+#error __STRICT_ANSI__ should not be defined.
+#endif
Index: lib/Frontend/InitPreprocessor.cpp
===================================================================
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -433,7 +433,7 @@
// Initialize language-specific preprocessor defines.
// Standard conforming mode?
- if (!LangOpts.GNUMode)
+ if (!LangOpts.GNUMode && !LangOpts.MSVCCompat)
Builder.defineMacro("__STRICT_ANSI__");
if (LangOpts.CPlusPlus11)
Index: test/Frontend/strict-ansi.c
===================================================================
--- /dev/null
+++ test/Frontend/strict-ansi.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fms-compatibility -verify %s
+// expected-no-diagnostics
+
+#if defined(__STRICT_ANSI__)
+#error __STRICT_ANSI__ should not be defined.
+#endif
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits