File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 6666#ifdef JANET_APPLE
6767#include <crt_externs.h>
6868#define environ (*_NSGetEnviron())
69+ #include <AvailabilityMacros.h>
6970#else
7071extern char * * environ ;
7172#endif
@@ -81,8 +82,14 @@ extern char **environ;
8182#ifndef JANET_SPAWN_NO_CHDIR
8283#ifdef __GLIBC__
8384#define JANET_SPAWN_CHDIR
84- #elif defined(JANET_APPLE ) /* Some older versions may not work here. */
85+ #elif defined(JANET_APPLE )
86+ /* The posix_spawn_file_actions_addchdir_np function
87+ * has only been implemented since macOS 10.15 */
88+ #if defined(MAC_OS_X_VERSION_10_15 ) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 )
8589#define JANET_SPAWN_CHDIR
90+ #else
91+ #define JANET_SPAWN_NO_CHDIR
92+ #endif
8693#elif defined(__FreeBSD__ ) /* Not all BSDs work, for example openBSD doesn't seem to support this */
8794#define JANET_SPAWN_CHDIR
8895#endif
You can’t perform that action at this time.
0 commit comments