darwin: make it possible to compile for iOS
Relocate the include of TargetConditionals.h and fixe the use of TARGET_OS_IPHONE. Furthermore, uv__fsevents_init() and uv__fsevents_close are now empty functions for iOS, since the FSEvents API is not available there.
This commit is contained in:
parent
149b16f123
commit
97c527ac43
@ -26,6 +26,7 @@
|
|||||||
# include <mach/mach.h>
|
# include <mach/mach.h>
|
||||||
# include <mach/task.h>
|
# include <mach/task.h>
|
||||||
# include <mach/semaphore.h>
|
# include <mach/semaphore.h>
|
||||||
|
# include <TargetConditionals.h>
|
||||||
# define UV_PLATFORM_SEM_T semaphore_t
|
# define UV_PLATFORM_SEM_T semaphore_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,7 @@
|
|||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
|
||||||
#include <TargetConditionals.h>
|
#include <CoreFoundation/CFRunLoop.h>
|
||||||
|
|
||||||
#if !TARGET_OS_IPHONE
|
|
||||||
#include <CoreServices/CoreServices.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#include <mach/mach_time.h>
|
#include <mach/mach_time.h>
|
||||||
|
|||||||
@ -21,6 +21,21 @@
|
|||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
|
||||||
|
/* iOS (currently) doesn't provide the FSEvents-API (nor CoreServices) */
|
||||||
|
|
||||||
|
int uv__fsevents_init(uv_fs_event_t* handle) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int uv__fsevents_close(uv_fs_event_t* handle) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* TARGET_OS_IPHONE */
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
@ -278,3 +293,5 @@ int uv__fsevents_close(uv_fs_event_t* handle) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* TARGET_OS_IPHONE */
|
||||||
|
|||||||
@ -62,7 +62,7 @@
|
|||||||
# define HAVE_KQUEUE 1
|
# define HAVE_KQUEUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__) && !defined(TARGET_OS_IPHONE)
|
#if defined(__APPLE__) && !TARGET_OS_IPHONE
|
||||||
# include <CoreServices/CoreServices.h>
|
# include <CoreServices/CoreServices.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -33,10 +33,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
# include <TargetConditionals.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__APPLE__) && !TARGET_OS_IPHONE
|
#if defined(__APPLE__) && !TARGET_OS_IPHONE
|
||||||
# include <crt_externs.h>
|
# include <crt_externs.h>
|
||||||
# define environ (*_NSGetEnviron())
|
# define environ (*_NSGetEnviron())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user