File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,15 @@ static void emitObjCConditional(raw_ostream &out,
5252}
5353
5454static void writePtrauthPrologue (raw_ostream &os) {
55- os << " #if __has_include(<ptrauth.h>)\n " ;
56- os << " # include <ptrauth.h>\n " ;
57- os << " #else\n " ;
58- os << " # ifndef __ptrauth_swift_value_witness_function_pointer\n " ;
59- os << " # define __ptrauth_swift_value_witness_function_pointer(x)\n " ;
60- os << " # endif\n " ;
61- os << " #endif\n " ;
55+ emitCxxConditional (os, [&]() {
56+ os << " #if __has_include(<ptrauth.h>)\n " ;
57+ os << " # include <ptrauth.h>\n " ;
58+ os << " #else\n " ;
59+ os << " # ifndef __ptrauth_swift_value_witness_function_pointer\n " ;
60+ os << " # define __ptrauth_swift_value_witness_function_pointer(x)\n " ;
61+ os << " # endif\n " ;
62+ os << " #endif\n " ;
63+ });
6264}
6365
6466static void writePrologue (raw_ostream &out, ASTContext &ctx,
Original file line number Diff line number Diff line change 3535// CHECK-NEXT: #include <stdbool.h>
3636// CHECK-NEXT: #include <string.h>
3737// CHECK-NEXT: #endif
38+ // CHECK-NEXT: #if defined(__cplusplus)
3839// CHECK-NEXT: #if __has_include(<ptrauth.h>)
3940// CHECK-NEXT: # include <ptrauth.h>
4041// CHECK-NEXT: #else
4142// CHECK-NEXT: # ifndef __ptrauth_swift_value_witness_function_pointer
4243// CHECK-NEXT: # define __ptrauth_swift_value_witness_function_pointer(x)
4344// CHECK-NEXT: # endif
4445// CHECK-NEXT: #endif
46+ // CHECK-NEXT: #endif
4547
4648// CHECK-LABEL: !defined(SWIFT_TYPEDEFS)
4749// CHECK-NEXT: # define SWIFT_TYPEDEFS 1
You can’t perform that action at this time.
0 commit comments