Check for existence of TARGET_OS_IPHONE first

Fixes build error on old SDKs that don't define TARGET_OS_IPHONE when
using new compilers that consider it an error to check undefined
TARGET_OS_ macros.

./lj_arch.h:127:5: error: 'TARGET_OS_IPHONE' is not defined, evaluates
to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
This commit is contained in:
Ryan Carsten Schmidt 2024-04-21 16:55:31 -05:00 committed by GitHub
parent b3e4987389
commit 920dc14873
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,7 +124,7 @@
#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS)
#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX
#if TARGET_OS_IPHONE
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#define LJ_TARGET_IOS 1
#else
#define LJ_TARGET_IOS 0