Merge bitcoin/bitcoin#33714: random: scope environ extern to macOS, BSDs and Illumos

79d6f458e2 random: scope environ extern to macOS, BSDs and Illumos (fanquake)

Pull request description:

  These platforms fail to compile with it removed.
  macOS: #33675
  BSDs / Illumos: https://github.com/hebasto/bitcoin-core-nightly/pull/79.

ACKs for top commit:
  l0rinc:
    ACK 79d6f458e2
  hebasto:
    re-ACK 79d6f458e2.

Tree-SHA512: dcaa15f0939d65a804107ceb110037f44d0ff70759f4d42fcc497a9c173ac28b1287b867f01732224788d1c1f9c883565bafc3abed3ccf28f1b67f23997ce3cf
This commit is contained in:
Hennadii Stepanov
2025-11-04 15:09:58 +00:00

View File

@@ -57,8 +57,12 @@
#include <sys/auxv.h>
#endif
#ifndef WIN32
extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms
#if defined(__APPLE__) || \
defined(__FreeBSD__) || \
defined(__NetBSD__) || \
defined(__OpenBSD__) || \
defined(__illumos__)
extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on the above platforms
#endif
namespace {