Skip to content

Commit 3a7ebc1

Browse files
add extra name-check wrapper for objc macros
1 parent c55ee04 commit 3a7ebc1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/PrintAsClang/PrintAsClang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ static void writePrologue(raw_ostream &out, ASTContext &ctx,
134134

135135
#define CLANG_MACRO_OBJC(NAME, ARGS, VALUE) \
136136
out << "#if defined(__OBJC__)\n" \
137+
"#if !defined(" #NAME ")\n" \
137138
"# define " #NAME #ARGS " " #VALUE "\n" \
139+
"#endif\n" \
138140
"#endif\n";
139141

140142
#define CLANG_MACRO_CXX(NAME, ARGS, VALUE, ALTERNATIVE) \

0 commit comments

Comments
 (0)