mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
iOS compile fix
`crt_externs.h` is available only available with iOS-13 sdk. we therefore add a `__has_include` check to see if it is actually available
This commit is contained in:
parent
a9686d6ecf
commit
1190e0c053
1 changed files with 1 additions and 1 deletions
|
@ -422,7 +422,7 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
||||||
#elif !defined(MI_USE_ENVIRON) || (MI_USE_ENVIRON!=0)
|
#elif !defined(MI_USE_ENVIRON) || (MI_USE_ENVIRON!=0)
|
||||||
// On Posix systemsr use `environ` to acces environment variables
|
// On Posix systemsr use `environ` to acces environment variables
|
||||||
// even before the C runtime is initialized.
|
// even before the C runtime is initialized.
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__) && defined(__has_include) && __has_include(<crt_externs.h>)
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
static char** mi_get_environ(void) {
|
static char** mi_get_environ(void) {
|
||||||
return (*_NSGetEnviron());
|
return (*_NSGetEnviron());
|
||||||
|
|
Loading…
Add table
Reference in a new issue