Skip to content

Commit

Permalink
TARGET_OS_IS_IPHONE is an oddball
Browse files Browse the repository at this point in the history
First, it was only ever defined in John's projectBuilder/Xcode files,
and THEN even withot a value, thus NEVER true in #if.
Also, it is elsewhere only use with #ifdef/#if defined.

And Then, TARGET_OS_* is a probably Next/OpenStep descendent thing,
(see your local TargetContitionals.h),
BUT these are NEVER TARGET_OS_IS_... but only TARGET_OS_...

We had warngins for that for a long time and Clang 18 is having noe of
that anyomre.

This changes the #if to an #if defined.
PROBALBY All references to TARGET_OS_IS_IPHONE should be nixed.
  • Loading branch information
krono committed Oct 10, 2024
1 parent 0484ab6 commit 9339f2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions platforms/Cross/vm/sqAtomicOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

#elif IS_32_BIT_ARCH

# if TARGET_OS_IS_IPHONE
# if defined(TARGET_OS_IS_IPHONE)
static inline void
AtomicSet(uint64_t *target, uint64_t new_value)
{
Expand Down Expand Up @@ -239,7 +239,7 @@ AtomicGet(__int64 *target)

#undef ATOMICADD16

#if TARGET_OS_IS_IPHONE
#if defined(TARGET_OS_IS_IPHONE)
# define sqAtomicAddConst(var,n) (assert(sizeof(var) == 4), OSAtomicAdd32(n,&(var))

#elif defined(_MSC_VER)
Expand Down Expand Up @@ -305,7 +305,7 @@ AtomicGet(__int64 *target)
* was made.
*/

#if TARGET_OS_IS_IPHONE
#if defined(TARGET_OS_IS_IPHONE)
# define sqCompareAndSwap(var,old,new) \
(sizeof(var) == 8 \
? OSAtomicCompareAndSwap64(old, new, &var) \
Expand Down

0 comments on commit 9339f2b

Please sign in to comment.