diff --git a/meson.build b/meson.build index a8d84c00b20..28c723410e1 100644 --- a/meson.build +++ b/meson.build @@ -1378,6 +1378,7 @@ functions_to_detect = { 'getrandom': '', 'qsort_s': '', 'posix_fallocate': '', + 'secure_getenv': '', } foreach f, prefix: functions_to_detect diff --git a/src/util/u_debug.h b/src/util/u_debug.h index 2f1a2dabed1..8e8319c0601 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -39,6 +39,7 @@ #define U_DEBUG_H_ #include +#include #include #if !defined(_WIN32) #include @@ -403,6 +404,13 @@ __normal_user(void) #endif } +#ifndef HAVE_SECURE_GETENV +static inline char *secure_getenv(const char *name) +{ + return getenv(name); +} +#endif + #define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \ static bool \ debug_get_option_ ## sufix (void) \