Skip to content

Commit e189414

Browse files
committed
Fix macOS posix_spawn_file_actions_addchdir availability handling
1 parent c4bb7ab commit e189414

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

ext/standard/proc_open.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,23 @@
4747
#define USE_POSIX_SPAWN
4848

4949
/* The non-_np variant is in macOS 26 (and _np deprecated) */
50-
# if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 260000
51-
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
52-
# else
53-
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
54-
# endif
50+
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED <= 260000
51+
52+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
53+
54+
#elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 26000
55+
56+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
57+
5558
#elif defined(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
56-
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
59+
60+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir
61+
5762
#else
58-
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
63+
64+
#define POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR posix_spawn_file_actions_addchdir_np
65+
66+
#endif
5967
#endif
6068

6169

0 commit comments

Comments
 (0)