Skip to content

Commit 5ea0d83

Browse files
GerHobbeltbenman64
authored andcommitted
fix build error on Windows due to incorrect RTL linkage for environ: must be a dllimport.
1 parent 29d01c7 commit 5ea0d83

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/cpp/subprocess/environ.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
#include "utf8_to_utf16.hpp"
77
using std::to_string;
88

9-
extern "C" char **environ;
9+
#if !defined(_DCRTIMP) // Windows-specific RTL DLL import macro
10+
#define _DCRTIMP
11+
#endif
12+
13+
extern "C" _DCRTIMP char **environ;
1014

1115
namespace subprocess {
1216
Environ cenv;
@@ -131,4 +135,4 @@ namespace subprocess {
131135
result += (char16_t)'\0';
132136
return result;
133137
}
134-
}
138+
}

0 commit comments

Comments
 (0)