--- modules/misc/inhibit/orig.xdg.c	2014-08-14 09:20:04.000000000 +0200
+++ modules/misc/inhibit/xdg.c	2017-08-18 14:11:43.000000000 +0200
@@ -48,7 +48,7 @@
     posix_spawnattr_t attr;
 };
 
-extern char **environ;
+#include <crt_externs.h>
 
 static void Timer (void *data)
 {
@@ -60,7 +60,7 @@
     pid_t pid;
 
     int err = posix_spawnp (&pid, "xdg-screensaver", NULL, &sys->attr,
-                            argv, environ);
+                            argv, *_NSGetEnviron());
     if (err == 0)
     {
         int status;
--- modules/stream_filter/orig.decomp.c	2015-04-13 21:54:35.000000000 +0200
+++ modules/stream_filter/decomp.c	2017-08-18 14:11:46.000000000 +0200
@@ -92,7 +92,7 @@
     int64_t      pts_delay;
 };
 
-extern char **environ;
+#include <crt_externs.h>
 
 static const size_t bufsize = 65536;
 #ifdef HAVE_VMSPLICE
@@ -361,7 +361,7 @@
                 if (!posix_spawn_file_actions_adddup2 (&actions, comp[0], 0)
                  && !posix_spawn_file_actions_adddup2 (&actions, uncomp[1], 1)
                  && !posix_spawnp (&p_sys->pid, path, &actions, NULL, argv,
-                                   environ))
+                                   *_NSGetEnviron()))
                 {
                     if (vlc_clone (&p_sys->thread, Thread, stream,
                                    VLC_THREAD_PRIORITY_INPUT) == 0)