mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 23:40:10 +01:00
util: Provide a secure_getenv fallback for platforms without it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27381>
This commit is contained in:
parent
0fa4ea98ca
commit
8b209a6200
2 changed files with 9 additions and 0 deletions
|
|
@ -1378,6 +1378,7 @@ functions_to_detect = {
|
|||
'getrandom': '',
|
||||
'qsort_s': '',
|
||||
'posix_fallocate': '',
|
||||
'secure_getenv': '',
|
||||
}
|
||||
|
||||
foreach f, prefix: functions_to_detect
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#define U_DEBUG_H_
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/types.h>
|
||||
|
|
@ -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) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue