aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-02-26 18:06:32 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-07-19 22:01:01 +0100
commit7703884ab19cd7ffddc5c52ba57dec82fbc8dc2b (patch)
treed46c41fbfb3449c174c0a106733cdbf7f11cfba8 /src
parented739d14b58b5e772a65b85bb421703963b06852 (diff)
downloadbitcoin-7703884ab19cd7ffddc5c52ba57dec82fbc8dc2b.tar.xz
Fix MSVC warning C4273 "inconsistent dll linkage"
When using CMake, the user can select the MSVC runtime library to be: 1) Statically-linked (with the corresponding `x64-windows-static` vcpkg triplet) or 2) Dynamically-linked (with the corresponding `x64-windows` vcpkg triplet) In the latter case, the compiler emits the C4273 warning. As the "Necessary on some platforms" comment does not apply to MSVC, skip the declaration for MSVC.
Diffstat (limited to 'src')
-rw-r--r--src/randomenv.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/randomenv.cpp b/src/randomenv.cpp
index 93d30a27fd..4754b597c5 100644
--- a/src/randomenv.cpp
+++ b/src/randomenv.cpp
@@ -58,7 +58,9 @@
#include <sys/auxv.h>
#endif
+#ifndef _MSC_VER
extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms
+#endif
namespace {