aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-09-23 21:28:24 +0000
committerSteve Naroff <snaroff@apple.com>2008-09-23 21:28:24 +0000
commitdca6d6e8b0868e8baf727bf13df12e6d83d2828f (patch)
tree801054cd9f80574662cbf0ac7985c4fed8a5adc5 /lib/Lex/Preprocessor.cpp
parentca3bb4f14fcfb606d9c9d6c574bb76131f952ed4 (diff)
Fix <rdar://problem/6240065> clang: __BLOCKS__ should be defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 50fafdc73b..81a09f5bfa 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -477,9 +477,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "__declspec(X)=");
}
// Directly modeled after the attribute-based implementation in GCC.
- if (PP.getLangOptions().Blocks)
+ if (PP.getLangOptions().Blocks) {
DefineBuiltinMacro(Buf, "__block=__attribute__((__blocks__(byref)))");
- else
+ DefineBuiltinMacro(Buf, "__BLOCKS__=1");
+ } else
// This allows "__block int unusedVar;" even when blocks are disabled.
// This is modeled after GCC's handling of __strong/__weak.
DefineBuiltinMacro(Buf, "__block=");