summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--system.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6b2f5fe70..8161dc266 100644
--- a/configure.ac
+++ b/configure.ac
@@ -521,7 +521,7 @@ AC_CHECK_FUNCS(fdatasync)
AC_REPLACE_FUNCS(stpcpy stpncpy)
-AC_CHECK_FUNCS(__secure_getenv)
+AC_CHECK_FUNCS([secure_getenv __secure_getenv])
AC_CHECK_FUNCS(
[mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown],
diff --git a/system.h b/system.h
index 6f0b76b67..f3b1bab32 100644
--- a/system.h
+++ b/system.h
@@ -35,7 +35,9 @@ char * stpcpy(char * dest, const char * src);
char * stpncpy(char * dest, const char * src, size_t n);
#endif
-#if HAVE___SECURE_GETENV
+#if HAVE_SECURE_GETENV
+#define getenv(_s) secure_getenv(_s)
+#elif HAVE___SECURE_GETENV
#define getenv(_s) __secure_getenv(_s)
#endif