Skip to content

Commit

Permalink
fix build error on Windows due to incorrect RTL linkage for environ
Browse files Browse the repository at this point in the history
…: must be a `dllimport`.
  • Loading branch information
GerHobbelt committed Oct 25, 2021
1 parent e1cae5e commit 15f9fbb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cpp/subprocess/environ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#include "utf8_to_utf16.hpp"
using std::to_string;

extern "C" char **environ;
#if !defined(_DCRTIMP) // Windows-specific RTL DLL import macro
#define _DCRTIMP
#endif

extern "C" _DCRTIMP char **environ;

namespace subprocess {
Environ cenv;
Expand Down Expand Up @@ -131,4 +135,4 @@ namespace subprocess {
result += (char16_t)'\0';
return result;
}
}
}

0 comments on commit 15f9fbb

Please sign in to comment.