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 authored and benman64 committed Aug 23, 2024
1 parent 29d01c7 commit 5ea0d83
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 5ea0d83

Please sign in to comment.