Skip to content

Commit 3de6cb7

Browse files
committed
concurrent-ruby-ext: fix build on Darwin 32-bit
1 parent 129cf00 commit 3de6cb7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/concurrent-ruby-ext/atomic_reference.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ VALUE ir_compare_and_set(volatile VALUE self, VALUE expect_value, VALUE new_valu
9191
return Qtrue;
9292
}
9393
#elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
94+
#if defined(__i386__) || defined(__ppc__)
95+
if (OSAtomicCompareAndSwap32(expect_value, new_value, (VALUE*) &DATA_PTR(self))) {
96+
return Qtrue;
97+
}
98+
#else
9499
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
95100
return Qtrue;
96101
}
102+
#endif
97103
#elif defined(__sun)
98104
/* Assuming VALUE is uintptr_t */
99105
/* Based on the definition of uintptr_t from /usr/include/sys/int_types.h */

0 commit comments

Comments
 (0)