[compiler-rt] r327904 - Cleanup of "extern char **environ" declaration

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 13:44:06 PDT 2018


Author: vitalybuka
Date: Mon Mar 19 13:44:06 2018
New Revision: 327904

URL: http://llvm.org/viewvc/llvm-project?rev=327904&view=rev
Log:
Cleanup of "extern char **environ" declaration

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=327904&r1=327903&r2=327904&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Mon Mar 19 13:44:06 2018
@@ -85,13 +85,11 @@ extern "C" {
 #include <sys/umtx.h>
 }
 #include <sys/thr.h>
-extern char **environ;  // provided by crt1
 #endif  // SANITIZER_FREEBSD
 
 #if SANITIZER_NETBSD
 #include <limits.h>  // For NAME_MAX
 #include <sys/sysctl.h>
-extern char **environ;  // provided by crt1
 #include <sys/exec.h>
 extern struct ps_strings *__ps_strings;
 #endif  // SANITIZER_NETBSD
@@ -99,15 +97,17 @@ extern struct ps_strings *__ps_strings;
 #if SANITIZER_SOLARIS
 #include <stdlib.h>
 #include <thread.h>
-
-extern char **_environ;
-#define environ _environ
 #endif
 
 #if !SANITIZER_ANDROID
 #include <sys/signal.h>
 #endif
 
+#if SANITIZER_SOLARIS
+#define environ _environ
+#endif
+extern char **_environ;
+
 #if SANITIZER_LINUX
 // <linux/time.h>
 struct kernel_timeval {




More information about the llvm-commits mailing list