Skip to content

Commit 7e41c6b

Browse files
committed
concurrent-ruby-ext: fix build on Darwin 32-bit
Fixes: #1063
1 parent 044020f commit 7e41c6b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/concurrent-ruby-ext/atomic_reference.c

+6
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ VALUE ir_get_and_set(VALUE self, VALUE new_value) {
7979

8080
VALUE ir_compare_and_set(volatile VALUE self, VALUE expect_value, VALUE new_value) {
8181
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
82+
#if defined(__i386__) || defined(__ppc__)
83+
if (OSAtomicCompareAndSwap32(expect_value, new_value, &DATA_PTR(self))) {
84+
return Qtrue;
85+
}
86+
#else
8287
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
8388
return Qtrue;
8489
}
90+
#endif
8591
#elif defined(__sun)
8692
/* Assuming VALUE is uintptr_t */
8793
/* Based on the definition of uintptr_t from /usr/include/sys/int_types.h */

0 commit comments

Comments
 (0)