Skip to content

Commit a2fc8c3

Browse files
committed
[Backtracing] Only include libproc.h if it's present.
rdar://104336548
1 parent 1e71f92 commit a2fc8c3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

stdlib/public/SwiftShims/swift/shims/_SwiftBacktracing.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@
2929

3030
#include <CoreFoundation/CFUUID.h>
3131
#include <CoreFoundation/CFString.h>
32-
#endif
3332

34-
#if TARGET_OS_OSX
33+
#if __has_include(<libproc.h>)
3534
#include <libproc.h>
35+
#else
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
extern int proc_name(int pid, void * buffer, uint32_t buffersize);
40+
#ifdef __cplusplus
41+
}
42+
#endif
43+
#endif
44+
3645
#endif
3746

3847
#ifdef __cplusplus

0 commit comments

Comments
 (0)