diff --git a/src/unix/core.c b/src/unix/core.c index f4b94e30c..ee52b1f41 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -49,17 +49,22 @@ # include #endif -#ifdef __APPLE__ -# include -# include /* _NSGetExecutablePath */ +#if defined(__APPLE__) # include # if defined(O_CLOEXEC) # define UV__O_CLOEXEC O_CLOEXEC -# endif +# endif /* defined(O_CLOEXEC) */ +# endif /* defined(__APPLE__) */ + + +#if defined(__APPLE__) && !TARGET_OS_IPHONE +# include +# include /* _NSGetExecutablePath */ # define environ (*_NSGetEnviron()) -#else +#else /* defined(__APPLE__) && !TARGET_OS_IPHONE */ extern char** environ; -#endif +#endif /* !(defined(__APPLE__) && !TARGET_OS_IPHONE) */ + #if defined(__DragonFly__) || \ defined(__FreeBSD__) || \