Skip to content

Commit 7703884

Browse files
committed
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.
1 parent ed739d1 commit 7703884

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/randomenv.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
#include <sys/auxv.h>
5959
#endif
6060

61+
#ifndef _MSC_VER
6162
extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms
63+
#endif
6264

6365
namespace {
6466

0 commit comments

Comments
 (0)