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
This commit is contained in:
Steve Naroff 2008-09-23 21:28:24 +00:00
Родитель ca3bb4f14f
Коммит dca6d6e8b0
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -477,9 +477,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "__declspec(X)="); DefineBuiltinMacro(Buf, "__declspec(X)=");
} }
// Directly modeled after the attribute-based implementation in GCC. // Directly modeled after the attribute-based implementation in GCC.
if (PP.getLangOptions().Blocks) if (PP.getLangOptions().Blocks) {
DefineBuiltinMacro(Buf, "__block=__attribute__((__blocks__(byref)))"); DefineBuiltinMacro(Buf, "__block=__attribute__((__blocks__(byref)))");
else DefineBuiltinMacro(Buf, "__BLOCKS__=1");
} else
// This allows "__block int unusedVar;" even when blocks are disabled. // This allows "__block int unusedVar;" even when blocks are disabled.
// This is modeled after GCC's handling of __strong/__weak. // This is modeled after GCC's handling of __strong/__weak.
DefineBuiltinMacro(Buf, "__block="); DefineBuiltinMacro(Buf, "__block=");