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