Skip to content

Instantly share code, notes, and snippets.

@leoncamel
Created November 28, 2011 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoncamel/1401120 to your computer and use it in GitHub Desktop.
Save leoncamel/1401120 to your computer and use it in GitHub Desktop.
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 77e5675..759080a 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -382,17 +382,12 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
# if !@HAVE_DECL_ENVIRON@
/* Set of environment variables and values. An array of strings of the form
"VARIABLE=VALUE", terminated with a NULL. */
-# if defined __APPLE__ && defined __MACH__
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron ())
-# else
-# ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
-# endif
+# endif
extern char **environ;
-# ifdef __cplusplus
+# ifdef __cplusplus
}
-# endif
# endif
# endif
#elif defined GNULIB_POSIXCHECK
@@ -407,6 +402,11 @@ _GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
# undef environ
# define environ (*rpl_environ ())
# endif
+#else
+# if defined __APPLE__ && defined __MACH__
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron ())
+# endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment