From: Nuno Lopes Date: Sat, 5 Jul 2008 19:32:25 +0000 (+0000) Subject: move the linux predefined macro definition to the TargetInfo, where it really belongs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=551d5e9811c0e68496bb2842163c6d99138d6ef9;p=clang move the linux predefined macro definition to the TargetInfo, where it really belongs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53149 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 4cf7e7bb8a..ac48e23f75 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -48,6 +48,11 @@ public: Define(Defs, "__APPLE__"); Define(Defs, "__MACH__"); #endif + +/* FIXME. we may also need to distinguish between darwin and linux targets */ +#ifdef linux + Define(Defs, "linux"); +#endif if (1) {// -fobjc-gc controls this. Define(Defs, "__weak", ""); diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 577e64a5cf..32ee8f0c81 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -433,11 +433,6 @@ 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) {