Hopefully fix parameters of setenv compat function

This commit is contained in:
Zachary Hall 2023-12-01 16:05:37 -08:00
parent 3d03ea6e27
commit 6a1b491844
2 changed files with 19 additions and 2 deletions

19
.vscode/settings.json vendored
View file

@ -12,6 +12,23 @@
"semaphore": "cpp", "semaphore": "cpp",
"valarray": "cpp", "valarray": "cpp",
"ratio": "cpp", "ratio": "cpp",
"algorithm": "cpp" "algorithm": "cpp",
"charconv": "cpp",
"optional": "cpp",
"format": "cpp",
"system_error": "cpp",
"array": "cpp",
"functional": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"__bit_reference": "cpp",
"__node_handle": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"deque": "cpp",
"__memory": "cpp",
"locale": "cpp",
"vector": "cpp"
} }
} }

View file

@ -2,7 +2,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <stdlib.h> #include <stdlib.h>
inline void setenv(char const *variable, char const *value, char replace) { inline void setenv(const char *variable, const char *value, char replace) {
if (replace || getenv(variable) == NULL || getenv(variable) == "") { if (replace || getenv(variable) == NULL || getenv(variable) == "") {
if (value == NULL) { if (value == NULL) {
_putenv_s(variable, ""); _putenv_s(variable, "");