Skip to content

Commit 0a8a8a1

Browse files
committed
Allow building swift-syntax in C++ interop mode
If swift-syntax is being built with `-cxx-interoperability-mode=default`, it fails because of `cannot initialize a variable of type 'AtomicBool *' with an rvalue of type 'void *'`. Add a cast here to fix the build issue. rdar://129252735
1 parent cb53fa1 commit 0a8a8a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/_SwiftSyntaxCShims/include/AtomicBool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ typedef struct {
2121
} AtomicBool;
2222

2323
static inline AtomicBool *_Nonnull swiftsyntax_atomic_bool_create(bool initialValue) {
24-
AtomicBool *atomic = malloc(sizeof(AtomicBool));
24+
AtomicBool *atomic = (AtomicBool *)malloc(sizeof(AtomicBool));
2525
atomic->value = initialValue;
2626
return atomic;
2727
}

0 commit comments

Comments
 (0)