From 1190e0c053b92d752db7d9d49f51bbba5c93f475 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 26 Aug 2020 11:47:24 +0800 Subject: [PATCH] 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 --- src/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index f29b387c..68aeb1df 100644 --- a/src/options.c +++ b/src/options.c @@ -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) // On Posix systemsr use `environ` to acces environment variables // even before the C runtime is initialized. -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(__has_include) && __has_include() #include static char** mi_get_environ(void) { return (*_NSGetEnviron());