20
20
21
21
#include <CoreFoundation/CFAvailability.h>
22
22
23
+ #if TARGET_OS_WASI
24
+ #define __HAS_DISPATCH__ 0
25
+ #else
23
26
#define __HAS_DISPATCH__ 1
27
+ #endif
24
28
25
29
#include <CoreFoundation/CFBase.h>
26
30
@@ -193,7 +197,7 @@ typedef int boolean_t;
193
197
#include <sys/stat.h> // mode_t
194
198
#endif
195
199
196
- #if TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WIN32
200
+ #if TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WIN32 || TARGET_OS_WASI
197
201
// Implemented in CFPlatform.c
198
202
CF_EXPORT bool OSAtomicCompareAndSwapPtr (void * oldp , void * newp , void * volatile * dst );
199
203
CF_EXPORT bool OSAtomicCompareAndSwapLong (long oldl , long newl , long volatile * dst );
@@ -227,9 +231,9 @@ CF_INLINE uint64_t mach_absolute_time() {
227
231
}
228
232
229
233
#define malloc_default_zone () (void *)0
230
- #endif // TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WIN32
234
+ #endif // TARGET_OS_LINUX || TARGET_OS_BSD || TARGET_OS_WIN32 || TARGET_OS_WASI
231
235
232
- #if TARGET_OS_LINUX || TARGET_OS_WIN32 || defined(__OpenBSD__ )
236
+ #if TARGET_OS_LINUX || TARGET_OS_WIN32 || defined(__OpenBSD__ ) || TARGET_OS_WASI
233
237
#define strtod_l (a ,b ,locale ) strtod(a,b)
234
238
#define strtoul_l (a ,b ,c ,locale ) strtoul(a,b,c)
235
239
#define strtol_l (a ,b ,c ,locale ) strtol(a,b,c)
@@ -244,17 +248,19 @@ CF_INLINE int flsl( long mask ) {
244
248
}
245
249
return idx ;
246
250
}
247
- #endif // TARGET_OS_LINUX || TARGET_OS_WIN32 || defined(__OpenBSD__)
251
+ #endif // TARGET_OS_LINUX || TARGET_OS_WIN32 || defined(__OpenBSD__) || TARGET_OS_WASI
248
252
249
- #if TARGET_OS_LINUX
253
+ #if TARGET_OS_LINUX || TARGET_OS_WASI
250
254
251
255
#define CF_PRIVATE extern __attribute__((visibility("hidden")))
252
256
#define __weak
253
257
254
258
#define strtoll_l (a ,b ,c ,locale ) strtoll(a,b,c)
255
259
#define strncasecmp_l (a , b , c , d ) strncasecmp(a, b, c)
256
260
261
+ #if !TARGET_OS_WASI
257
262
#include <pthread.h>
263
+ #endif
258
264
259
265
#if TARGET_OS_ANDROID
260
266
typedef unsigned long fd_mask ;
0 commit comments