Author: snaroff
Date: Tue Sep 23 16:28:24 2008
New Revision: 56503

URL: http://llvm.org/viewvc/llvm-project?rev=56503&view=rev
Log:
Fix <rdar://problem/6240065> clang: __BLOCKS__ should be defined.

Modified:
    cfe/trunk/lib/Lex/Preprocessor.cpp

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=56503&r1=56502&r2=56503&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Tue Sep 23 16:28:24 2008
@@ -477,9 +477,10 @@
     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=");


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to