From bb19523a0a2db1e8afcd6b22a090fb48b9e7622d Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 17 Apr 2023 21:35:08 -0400 Subject: [PATCH] gio: fix build on older macOS SDKs The merge request !2848 added code to automatically detect the module prefix on macOS, with a test for the Mac #define TARGET_OS_OSX. However, older versions of the SDK (at least 10.11) don't provide this #define, leading to build failure. If the #define is missing, fall back to checking TARGET_OS_MAC. On newer SDKs this symbol is also true for watchOS, etc., but in those situations TARGET_OS_OSX is available. --- gio/giomodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gio/giomodule.c b/gio/giomodule.c index 47b8de27e..17fabe640 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -1273,7 +1273,9 @@ get_gio_module_dir (void) module_dir = g_strdup (GIO_MODULE_DIR); #ifdef __APPLE__ #include "TargetConditionals.h" -#if TARGET_OS_OSX +/* Only auto-relocate on macOS, not watchOS etc; older macOS SDKs only define TARGET_OS_MAC */ +#if (defined (TARGET_OS_OSX) && TARGET_OS_OSX) || \ + (!defined (TARGET_OS_OSX) && defined (TARGET_OS_MAC) && TARGET_OS_MAC) #include { g_autofree gchar *path = NULL;