SQLite Forum

Patch to fix compilation on Mac Catalyst
Login
The `HAVE_GETHOSTUUID` workaround is an incomplete fix, because the `ifdef` logic is still incorrect when compiling for Mac Catalyst. This patch resolves that issue.

Cheers!

```
 src/os_unix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/os_unix.c b/src/os_unix.c
index f2ac89f2c..9c4361b88 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -122,7 +122,8 @@
 # if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \
                             (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000))
 #    if (!defined(TARGET_OS_EMBEDDED) || (TARGET_OS_EMBEDDED==0)) \
-         && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0))
+         && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0)) \
+         && (!defined(TARGET_OS_MACCATALYST) || (TARGET_OS_MACCATALYST==0))
 #      undef HAVE_GETHOSTUUID
 #      define HAVE_GETHOSTUUID 1
 #    else
```