File tree Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -805,7 +805,12 @@ CF_EXPORT void _NS_pthread_setname_np(const char *name);
805
805
#define pthread_setname_np _NS_pthread_setname_np
806
806
#endif
807
807
808
- #if DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_LINUX
808
+ #if DEPLOYMENT_TARGET_LINUX
809
+ CF_EXPORT Boolean _CFIsMainThread (void );
810
+ #define pthread_main_np _CFIsMainThread
811
+ #endif
812
+
813
+ #if DEPLOYMENT_TARGET_WINDOWS
809
814
// replacement for DISPATCH_QUEUE_OVERCOMMIT until we get a bug fix in dispatch on Windows
810
815
// <rdar://problem/7923891> dispatch on Windows: Need queue_private.h
811
816
#define DISPATCH_QUEUE_OVERCOMMIT 2
Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ const char *_CFProcessPath(void) {
157
157
158
158
#if DEPLOYMENT_TARGET_LINUX
159
159
#include <unistd.h>
160
+ #include <syscall.h>
161
+
162
+ Boolean _CFIsMainThread (void ) {
163
+ return syscall (SYS_gettid ) == getpid ();
164
+ }
160
165
161
166
const char * _CFProcessPath (void ) {
162
167
if (__CFProcessPath ) return __CFProcessPath ;
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ DISPATCH_EXPORT void _dispatch_main_queue_callback_4CF(void);
78
78
#include <sys/eventfd.h>
79
79
#include <sys/timerfd.h>
80
80
81
- #define _dispatch_get_main_queue_port_4CF dispatch_get_main_queue_eventfd_np
82
- #define _dispatch_main_queue_callback_4CF (x ) dispatch_main_queue_drain_np ()
81
+ #define _dispatch_get_main_queue_port_4CF dispatch_get_main_queue_eventfd_4CF
82
+ #define _dispatch_main_queue_callback_4CF (x ) dispatch_main_queue_drain_4CF ()
83
83
#endif
84
84
85
85
#if DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_IPHONESIMULATOR || DEPLOYMENT_TARGET_LINUX
Original file line number Diff line number Diff line change 64
64
'-I/usr/include/libxml2'
65
65
]
66
66
67
- # Disable until changes are merged into dispatch.
67
+ # Configure use of Dispatch in CoreFoundation and Foundation if libdispatch is being built
68
68
#if "LIBDISPATCH_SOURCE_DIR" in Configuration.current.variables:
69
- # foundation.CFLAGS += " "+" ".join([
70
- # '-DDEPLOYMENT_ENABLE_LIBDISPATCH',
71
- # '-I'+Configuration.current.variables["LIBDISPATCH_SOURCE_DIR"],
72
- # '-I'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/tests' # for include of dispatch/private.h in CF
73
- # ])
74
-
69
+ # foundation.CFLAGS += " "+" ".join([
70
+ # '-DDEPLOYMENT_ENABLE_LIBDISPATCH',
71
+ # '-I'+Configuration.current.variables["LIBDISPATCH_SOURCE_DIR"],
72
+ # '-I'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/tests' # for include of dispatch/private.h in CF
73
+ # ])
74
+ # swift_cflags += ([
75
+ # '-DDEPLOYMENT_ENABLE_LIBDISPATCH',
76
+ # '-I'+Configuration.current.variables["LIBDISPATCH_SOURCE_DIR"],
77
+ # ])
78
+ # foundation.LDFLAGS += '-ldispatch -L'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/src/.libs '
75
79
76
80
foundation .SWIFTCFLAGS = " " .join (swift_cflags )
77
81
You can’t perform that action at this time.
0 commit comments