--- tools/ippeveprinter.c 2026-04-28 01:13:21.000000000 +0800 +++ tools/ippeveprinter.c 2026-06-08 21:44:18.000000000 +0800 @@ -38,7 +38,12 @@ typedef ULONG nfds_t; # define poll WSAPoll #else +# ifdef __APPLE__ +# include +# define environ (*_NSGetEnviron()) +# else extern char **environ; +# endif # include # include --- scheduler/util.c 2026-04-28 01:13:21.000000000 +0800 +++ scheduler/util.c 2026-06-08 21:44:58.000000000 +0800 @@ -18,7 +18,8 @@ #include #ifdef __APPLE__ # include -extern char **environ; +# include +# define environ (*_NSGetEnviron()) #endif /* __APPLE__ */ --- scheduler/process.c 2026-04-28 01:13:21.000000000 +0800 +++ scheduler/process.c 2026-06-08 21:46:45.000000000 +0800 @@ -20,7 +20,12 @@ #endif /* __APPLE__ */ #ifdef HAVE_POSIX_SPAWN # include -extern char **environ; +# ifdef __APPLE__ +# include +# define environ (*_NSGetEnviron()) +# else + extern char **environ; +# endif /* Don't use posix_spawn on systems with bugs in their implementations... */ # if defined(OpenBSD) && OpenBSD < 201505 # define USE_POSIX_SPAWN 0 --- cups/tls-darwin.h 2026-04-28 01:13:21.000000000 +0800 +++ cups/tls-darwin.h 2026-06-08 21:47:30.000000000 +0800 @@ -10,7 +10,8 @@ /**** This file is included from tls-darwin.c ****/ -extern char **environ; +#include +#define environ (*_NSGetEnviron()) #ifndef _SECURITY_VERSION_GREATER_THAN_57610_ typedef CF_OPTIONS(uint32_t, SecKeyUsage) {