Commit f1186acfd43b2da98f09e40e9aecf164ac17d9a5

Adrian Perez de Castro 2019-08-05T15:53:04

MSVC: Provide implementations of [un]setenv() Reference: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-s-wputenv-s

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/test.h b/test/test.h
index 297c062..031806f 100644
--- a/test/test.h
+++ b/test/test.h
@@ -95,3 +95,8 @@ test_disable_stdin_echo(void);
 
 void
 test_enable_stdin_echo(void);
+
+#ifdef _MSC_VER
+#define setenv(varname, value, overwrite) _putenv_s((varname), (value))
+#define unsetenv(varname) _putenv_s(varname, "")
+#endif