forked from OSchip/llvm-project
__CONSTANT_CFSTRINGS__ should be defined even in C mode, otherwise the CFSTR
won't expand to the builtin. This fixes rdar://6248329 llvm-svn: 57164
This commit is contained in:
parent
a97132a9c4
commit
1b0a00a4c9
|
@ -488,12 +488,12 @@ static void InitializePredefinedMacros(Preprocessor &PP,
|
|||
|
||||
if (PP.getLangOptions().NeXTRuntime)
|
||||
DefineBuiltinMacro(Buf, "__NEXT_RUNTIME__=1");
|
||||
|
||||
// darwin_constant_cfstrings controls this. This is also dependent
|
||||
// on other things like the runtime I believe.
|
||||
DefineBuiltinMacro(Buf, "__CONSTANT_CFSTRINGS__=1");
|
||||
}
|
||||
|
||||
// darwin_constant_cfstrings controls this. This is also dependent
|
||||
// on other things like the runtime I believe. This is set even for C code.
|
||||
DefineBuiltinMacro(Buf, "__CONSTANT_CFSTRINGS__=1");
|
||||
|
||||
if (PP.getLangOptions().ObjC2)
|
||||
DefineBuiltinMacro(Buf, "OBJC_NEW_PROPERTIES");
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// RUN: clang -emit-llvm %s -o %t
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
void f() {
|
||||
CFSTR("Hello, World!");
|
||||
}
|
||||
|
||||
// rdar://6248329
|
||||
void *G = CFSTR("yo joe");
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue