lib:replace: Check if HAVE_DECL_ENVIRON is defined first
authorAndreas Schneider <asn@samba.org>
Tue, 20 Nov 2018 11:01:32 +0000 (12:01 +0100)
committerGary Lockyer <gary@samba.org>
Wed, 28 Nov 2018 22:19:20 +0000 (23:19 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/replace/replace.h

index 732a822685824cdeeea95cdaa0c9309a5d1b96a2..a6cafc10d66b149c003762190948320e3efc4a31 100644 (file)
@@ -272,6 +272,7 @@ char *rep_strndup(const char *s, size_t n);
 size_t rep_strnlen(const char *s, size_t n);
 #endif
 
+#if defined(HAVE_DECL_ENVIRON)
 #if !HAVE_DECL_ENVIRON
 #ifdef __APPLE__
 #include <crt_externs.h>
@@ -280,6 +281,7 @@ size_t rep_strnlen(const char *s, size_t n);
 extern char **environ;
 #endif
 #endif
+#endif /* defined(HAVE_DECL_ENVIRON) */
 
 #ifndef HAVE_SETENV
 #define setenv rep_setenv