-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix C23 (GCC 15) WIN32 compatibility for rb_define_* functions #13202
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
Conversation
Fixes [Bug #21286]
✅ All Tests passed!✖️no tests failed ✔️61958 tests passed(3 flakes) |
Thanks for this. I just ran it with GCC 15 and it passed. The only warnings were existing digest warnings. See commit for a temporary way to install GCC 15. It adds about 25 seconds to the setup, but given the overall time for the job, it's not bad. The commit removes a 'spacing' blank line, not needed... That time would drop if I make changes as mentioned in the Ruby issue tracker. To lock to a commit for the action, use
|
#define rb_define_method(klass, mid, func, arity) rb_define_method((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | ||
#define rb_define_method_id(klass, mid, func, arity) rb_define_method_id((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | ||
#define rb_define_singleton_method(obj, mid, func, arity) rb_define_singleton_method((obj), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | ||
#define rb_define_protected_method(klass, mid, func, arity) rb_define_protected_method((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | ||
#define rb_define_private_method(klass, mid, func, arity) rb_define_private_method((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | ||
#define rb_define_module_function(mod, mid, func, arity) rb_define_module_function((mod), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | ||
#define rb_define_global_function(mid, func, arity) rb_define_global_function((mid), (VALUE (*)(ANYARGS))(func), (arity)) |
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.
Looks fine, and use RBIMPL_CAST
.
#define rb_define_method(klass, mid, func, arity) rb_define_method((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_method_id(klass, mid, func, arity) rb_define_method_id((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_singleton_method(obj, mid, func, arity) rb_define_singleton_method((obj), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_protected_method(klass, mid, func, arity) rb_define_protected_method((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_private_method(klass, mid, func, arity) rb_define_private_method((klass), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_module_function(mod, mid, func, arity) rb_define_module_function((mod), (mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_global_function(mid, func, arity) rb_define_global_function((mid), (VALUE (*)(ANYARGS))(func), (arity)) | |
#define rb_define_method(klass, mid, func, arity) rb_define_method((klass), (mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) | |
#define rb_define_method_id(klass, mid, func, arity) rb_define_method_id((klass), (mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) | |
#define rb_define_singleton_method(obj, mid, func, arity) rb_define_singleton_method((obj), (mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) | |
#define rb_define_protected_method(klass, mid, func, arity) rb_define_protected_method((klass), (mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) | |
#define rb_define_private_method(klass, mid, func, arity) rb_define_private_method((klass), (mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) | |
#define rb_define_module_function(mod, mid, func, arity) rb_define_module_function((mod), (mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) | |
#define rb_define_global_function(mid, func, arity) rb_define_global_function((mid), RBIMPL_CAST((VALUE (*)(ANYARGS))(func)), (arity)) |
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.
It's not necessary since it's !defined(__cplusplus)
.
No description provided.