-
Notifications
You must be signed in to change notification settings - Fork 417
concurrent-ruby-ext: fix build on Darwin 32-bit #1064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
For the record, this works neatly with Ruby 3.3, while Ruby 3.2 also needs |
|
Arguments should be explicitly casted to avoid the warning/error. One problem though is we have no way to test macOS 32-bit, so it should be considered basically unsupported. |
|
@eregon If you suggest a better fix, I can test that locally both on ppc and i386. |
| VALUE ir_compare_and_set(volatile VALUE self, VALUE expect_value, VALUE new_value) { | ||
| #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 | ||
| #if defined(__i386__) || defined(__ppc__) | ||
| if (OSAtomicCompareAndSwap32(expect_value, new_value, &DATA_PTR(self))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (OSAtomicCompareAndSwap32(expect_value, new_value, &DATA_PTR(self))) { | |
| if (OSAtomicCompareAndSwap32(expect_value, new_value, (VALUE*) &DATA_PTR(self))) { |
Can you try this?
I think it should solve your warning on Ruby 3.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will try that, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upd. No, it still fails if the error is not downgraded to warning with a flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have still added (VALUE*) there and rebased to master.
Fixes: #1063