[Openmp-commits] [openmp] r248198 - Darwin is the exception when it comes to accessing environ, all other

Joerg Sonnenberger via Openmp-commits openmp-commits at lists.llvm.org
Mon Sep 21 12:37:05 PDT 2015


Author: joerg
Date: Mon Sep 21 14:37:05 2015
New Revision: 248198

URL: http://llvm.org/viewvc/llvm-project?rev=248198&view=rev
Log:
Darwin is the exception when it comes to accessing environ, all other
Unix-like systems can follow the same code path.

Modified:
    openmp/trunk/runtime/src/kmp_environment.c

Modified: openmp/trunk/runtime/src/kmp_environment.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_environment.c?rev=248198&r1=248197&r2=248198&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_environment.c (original)
+++ openmp/trunk/runtime/src/kmp_environment.c Mon Sep 21 14:37:05 2015
@@ -64,13 +64,11 @@
 #if KMP_OS_UNIX
     #include <stdlib.h>    // getenv, setenv, unsetenv.
     #include <string.h>    // strlen, strcpy.
-    #if KMP_OS_LINUX || KMP_OS_FREEBSD
-        extern char * * environ;
-    #elif KMP_OS_DARWIN
+    #if KMP_OS_DARWIN
         #include <crt_externs.h>
         #define environ (*_NSGetEnviron())
     #else
-        #error Unknown or unsupported OS.
+        extern char * * environ;
     #endif
 #elif KMP_OS_WINDOWS
     #include <windows.h>   // GetEnvironmentVariable, SetEnvironmentVariable, GetLastError.




More information about the Openmp-commits mailing list