Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a4c7cc

Browse files
authored
Forward declare OSSpinLockLock on MacOS since it's not shipped on the system. (llvm#101392)
Fixes build errors on some SDKs. rdar://132607572
1 parent 3403b59 commit 3a4c7cc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
#include "rtsan/rtsan_context.h"
2222

2323
#if SANITIZER_APPLE
24+
25+
#if TARGET_OS_MAC
26+
// On MacOS OSSpinLockLock is deprecated and no longer present in the headers,
27+
// but the symbol still exists on the system. Forward declare here so we
28+
// don't get compilation errors.
29+
#include <stdint.h>
30+
extern "C" {
31+
typedef int32_t OSSpinLock;
32+
void OSSpinLockLock(volatile OSSpinLock *__lock);
33+
}
34+
#endif
35+
2436
#include <libkern/OSAtomic.h>
2537
#include <os/lock.h>
2638
#endif

0 commit comments

Comments
 (0)