summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2008-07-05 17:58:44 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2008-07-05 17:58:44 +0000
commit9b6de71b7df978dc41f240711bf98fe1b65c81f4 (patch)
tree8dccf60d6235230569787879d050b1e758263817 /clang/lib/Lex/Preprocessor.cpp
parenta7c7c6b01147e6255d2e12ac16bc7066448a09cf (diff)
downloadbcm5719-llvm-9b6de71b7df978dc41f240711bf98fe1b65c81f4.tar.gz
bcm5719-llvm-9b6de71b7df978dc41f240711bf98fe1b65c81f4.zip
predefine the macro linux when compiled on a linux system. this fixes the build of libtidy
llvm-svn: 53145
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 32ee8f0c817..577e64a5cfe 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -433,6 +433,11 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "__FINITE_MATH_ONLY__=0");
DefineBuiltinMacro(Buf, "__NO_INLINE__=1");
DefineBuiltinMacro(Buf, "__PIC__=1");
+
+/* FIXME: this check should be moved to the configure process */
+#ifdef linux
+ DefineBuiltinMacro(Buf, "linux=1");
+#endif
if (PP.getLangOptions().CPlusPlus) {
OpenPOWER on IntegriCloud