Skip to content

Commit 79d6f45

Browse files
committed
random: scope environ extern to macOS, BSDs and Illumos
These platforms fail to compile with it removed.
1 parent 292ea0e commit 79d6f45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/randomenv.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@
5757
#include <sys/auxv.h>
5858
#endif
5959

60-
#ifndef WIN32
61-
extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms
60+
#if defined(__APPLE__) || \
61+
defined(__FreeBSD__) || \
62+
defined(__NetBSD__) || \
63+
defined(__OpenBSD__) || \
64+
defined(__illumos__)
65+
extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on the above platforms
6266
#endif
6367

6468
namespace {

0 commit comments

Comments
 (0)