]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Fix handling of environ so that it works on older systems.
authorChris Hanson <org/chris-hanson/cph>
Mon, 19 Sep 2022 02:06:43 +0000 (19:06 -0700)
committerChris Hanson <org/chris-hanson/cph>
Mon, 19 Sep 2022 02:06:43 +0000 (19:06 -0700)
src/microcode/configure.ac
src/microcode/prosproc.c

index 35fd41f2e3d139561c7429bc8132941757da6204..1f3711578baadad849f193cef0be7421888be6ad 100644 (file)
@@ -569,6 +569,8 @@ AC_CHECK_TYPE([speed_t],
        [Define to `short' if <termios.h> doesn't define.])],
     [SCM_INC_TERMIO])
 
+AC_CHECK_DECLS([__environ, environ])
+
 define([SCM_INC_FENV],
     [
     #include <fenv.h>
index c83c896f187df774c69c1090dd3b464a51be4783..990dfd7add8f549722bc8bd0ddc4648ab54e577c 100644 (file)
@@ -32,6 +32,17 @@ USA.
 #include "osproc.h"
 #include "osio.h"
 
+#ifdef __unix__
+   #include "unistd.h"
+   #if !(defined(HAVE_DECL_ENVIRON) && HAVE_DECL_ENVIRON)
+      #if defined(HAVE_DECL___ENVIRON) && HAVE_DECL___ENVIRON
+         #define environ __environ
+      #else
+         extern char ** environ;
+      #endif
+   #endif
+#endif
+
 extern Tchannel arg_channel (int);
 
 static Tprocess