Skip to content

Commit 86eec61

Browse files
authored
Merge pull request #2590 from 3405691582/CF_LinuxAlsoBSD
2 parents 25543fc + 26f565d commit 86eec61

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const char *_CFProcessPath(void) {
131131
}
132132
#endif
133133

134-
#if TARGET_OS_MAC || TARGET_OS_WIN32
134+
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_BSD
135135
CF_CROSS_PLATFORM_EXPORT Boolean _CFIsMainThread(void) {
136136
return pthread_main_np() == 1;
137137
}
@@ -619,7 +619,7 @@ CF_PRIVATE void __CFTSDInitialize() {
619619
static void __CFTSDSetSpecific(void *arg) {
620620
#if TARGET_OS_MAC
621621
pthread_setspecific(__CFTSDIndexKey, arg);
622-
#elif TARGET_OS_LINUX
622+
#elif TARGET_OS_LINUX || TARGET_OS_BSD
623623
pthread_setspecific(__CFTSDIndexKey, arg);
624624
#elif TARGET_OS_WIN32
625625
FlsSetValue(__CFTSDIndexKey, arg);
@@ -629,7 +629,7 @@ static void __CFTSDSetSpecific(void *arg) {
629629
static void *__CFTSDGetSpecific() {
630630
#if TARGET_OS_MAC
631631
return pthread_getspecific(__CFTSDIndexKey);
632-
#elif TARGET_OS_LINUX
632+
#elif TARGET_OS_LINUX || TARGET_OS_BSD
633633
return pthread_getspecific(__CFTSDIndexKey);
634634
#elif TARGET_OS_WIN32
635635
return FlsGetValue(__CFTSDIndexKey);

CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ typedef int boolean_t;
152152
typedef unsigned long fd_mask;
153153
#endif
154154

155-
#if !TARGET_OS_ANDROID && !TARGET_OS_CYGWIN
155+
#if !TARGET_OS_ANDROID && !TARGET_OS_CYGWIN && !TARGET_OS_BSD
156156
CF_INLINE size_t
157157
strlcpy(char * dst, const char * src, size_t maxlen) {
158158
const size_t srclen = strlen(src);
@@ -180,7 +180,7 @@ strlcat(char * dst, const char * src, size_t maxlen) {
180180
}
181181
#endif
182182

183-
#if !TARGET_OS_CYGWIN
183+
#if !TARGET_OS_CYGWIN && !TARGET_OS_BSD
184184
#define issetugid() 0
185185
#endif
186186

@@ -250,7 +250,7 @@ void OSMemoryBarrier();
250250

251251
#endif
252252

253-
#if TARGET_OS_LINUX
253+
#if TARGET_OS_LINUX || TARGET_OS_BSD
254254
#include <sys/param.h>
255255
#endif
256256
#if TARGET_OS_WIN32 || TARGET_OS_LINUX

CoreFoundation/Collections.subproj/CFData.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ CF_INLINE unsigned long __CFPageSize() {
4343
GetSystemInfo(&sysInfo);
4444
return sysInfo.dwPageSize;
4545
}
46-
#elif TARGET_OS_LINUX
46+
#elif TARGET_OS_LINUX || TARGET_OS_BSD
4747
#include <unistd.h>
4848
CF_INLINE unsigned long __CFPageSize() {
4949
return (unsigned long)getpagesize();

CoreFoundation/PlugIn.subproj/CFBundle_Resources.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <errno.h>
2626
#include <sys/types.h>
2727

28-
#if TARGET_OS_MAC || TARGET_OS_LINUX
28+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
2929
#include <unistd.h>
3030
#if !TARGET_OS_ANDROID
3131
#include <sys/sysctl.h>

CoreFoundation/Preferences.subproj/CFXMLPreferencesDomain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void __CFMilliSleep(uint32_t msecs) {
5555
SleepEx(msecs, false);
5656
#elif defined(__svr4__) || defined(__hpux__)
5757
sleep((msecs + 900) / 1000);
58-
#elif TARGET_OS_OSX || TARGET_OS_LINUX
58+
#elif TARGET_OS_OSX || TARGET_OS_LINUX || TARGET_OS_BSD
5959
struct timespec input;
6060
input.tv_sec = msecs / 1000;
6161
input.tv_nsec = (msecs - input.tv_sec * 1000) * 1000000;

CoreFoundation/String.subproj/CFBurstTrie.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <fcntl.h>
1919
#include <sys/stat.h>
2020
#include <limits.h>
21-
#if TARGET_OS_MAC || TARGET_OS_LINUX
21+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
2222
#include <unistd.h>
2323
#include <sys/param.h>
2424
#include <sys/mman.h>

0 commit comments

Comments
 (0)