aboutsummaryrefslogtreecommitdiff
path: root/src/windows_port.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/windows_port.h')
-rw-r--r--src/windows_port.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/windows_port.h b/src/windows_port.h
index 61cf5b7..59a310e 100644
--- a/src/windows_port.h
+++ b/src/windows_port.h
@@ -77,6 +77,7 @@ extern int GFLAGS_DLL_DECL safe_vsnprintf(char *str, size_t size,
# pragma warning(push)
# pragma warning(disable: 4996) // ignore getenv security warning
#endif
+#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
inline void setenv(const char* name, const char* value, int) {
// In windows, it's impossible to set a variable to the empty string.
// We handle this by setting it to "0" and the NUL-ing out the \0.
@@ -98,6 +99,7 @@ inline void setenv(const char* name, const char* value, int) {
*getenv(name) = '\0'; // works when putenv() copies nameval
}
}
+#endif
#ifdef _MSC_VER
# pragma warning(pop)
#endif