Skip to content

Commit 6634ee3

Browse files
committed
Take BSD build fixes.
1 parent 00d8416 commit 6634ee3

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CoreFoundation/Base.subproj/CFInternal.h

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ CF_EXTERN_C_BEGIN
122122
#if _POSIX_THREADS
123123
#include <pthread.h>
124124
#endif
125+
#if __has_include(<pthread_np.h>)
126+
#include <pthread_np.h>
127+
#endif
125128

126129
#if !DEPLOYMENT_RUNTIME_SWIFT && __has_include(<os/log.h>)
127130
#include <os/log.h>

CoreFoundation/PlugIn.subproj/CFBundle_Internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ CF_PRIVATE const CFStringRef _kCFBundleUseAppleLocalizationsKey;
429429
// The buffer must be PATH_MAX long or more.
430430
static bool _CFGetPathFromFileDescriptor(int fd, char *path);
431431

432-
#if TARGET_OS_MAC || TARGET_OS_BSD
432+
#if TARGET_OS_MAC || (TARGET_OS_BSD && !defined(__OpenBSD__))
433433

434434
static bool _CFGetPathFromFileDescriptor(int fd, char *path) {
435435
return fcntl(fd, F_GETPATH, path) != -1;

CoreFoundation/PlugIn.subproj/CFBundle_Resources.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <errno.h>
2727
#include <sys/types.h>
2828

29-
#if !TARGET_OS_MAC && !TARGET_OS_BSD
29+
#if (!TARGET_OS_MAC && !TARGET_OS_BSD) || defined(__OpenBSD__)
3030
#define strnstr(haystack, needle, size) strstr(haystack, needle)
3131
#endif
3232

CoreFoundation/URL.subproj/CFURL.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <stdlib.h>
2222
#include <stdio.h>
2323
#include <string.h>
24-
#if TARGET_OS_MAC || TARGET_OS_LINUX
24+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
2525
#if TARGET_OS_OSX
2626
#include <CoreFoundation/CFNumberFormatter.h>
2727
#endif

0 commit comments

Comments
 (0)