Correctly check the TARGET_IPHONE_SIMULATOR macro

The macro may be defined to 0; the code needs to check the value, not
just whether it's defined.

Recent Clang versions will define all Apple "target OS" macros by
default (see bug).

Bug: chromium:1519899
Change-Id: I3d61f1b23de06d7db7db7916182a789f26345bce
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5249072
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Hans Wennborg 2024-01-30 14:39:06 +01:00 committed by libyuv LUCI CQ
parent 3e435fe6d4
commit d359a9f922

View File

@ -13,8 +13,12 @@
#ifdef HAVE_JPEG #ifdef HAVE_JPEG
#include <assert.h> #include <assert.h>
#if !defined(TARGET_IPHONE_SIMULATOR)
#define TARGET_IPHONE_SIMULATOR 0
#endif
#if !defined(__pnacl__) && !defined(__CLR_VER) && \ #if !defined(__pnacl__) && !defined(__CLR_VER) && \
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR) !defined(COVERAGE_ENABLED) && !TARGET_IPHONE_SIMULATOR
// Must be included before jpeglib. // Must be included before jpeglib.
#include <setjmp.h> #include <setjmp.h>
#define HAVE_SETJMP #define HAVE_SETJMP