Skip to content

Conversation

@cardmagic
Copy link

Summary

Fixes compilation errors on Ruby 3.4 caused by stricter function pointer type checking.

  • Fix argc values to match function signatures
  • Fix parameter order for variadic functions
  • Fix double pointer typos (VALUE *argv[]VALUE *argv)
  • Remove unused parameters from rng max/min/size
  • Update rb_rescue callback signature (2 args required)
  • Use GSL 2.8 API (gsl_bspline_ncontrol)
  • Remove duplicate gsl_matrix_complex_conjugate (now in GSL 2.8+)

Test Plan

  • Compiles on Ruby 3.4.8 + GSL 2.8 + macOS arm64
  • Full test suite passes: 755 tests, 1,514,054 assertions, 0 failures, 0 errors

Fixes #75

Ruby 3.4 enforces stricter type checking for function pointers passed to
rb_define_method and rb_define_module_function.

Changes:
- Fix argc values to match function signatures
- Fix parameter order for variadic functions (int argc, VALUE *argv, VALUE self)
- Fix VALUE *argv[] typos (double pointer -> single pointer)
- Remove unused parameters from rng max/min/size functions
- Update rb_rescue callback to take 2 arguments
- Fix CLASS_OF() calls to pass VALUE instead of C struct pointer
- Use GSL 2.8 API (gsl_bspline_ncontrol)
- Remove duplicate gsl_matrix_complex_conjugate (now in GSL 2.8+)
- Add explicit VALUE cast for RARRAY_LEN with void* params

Tested with Ruby 3.4.8, GSL 2.8 on macOS arm64.
Full test suite: 755 tests, 1,514,054 assertions, 0 failures.

Fixes SciRuby#75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ruby 3.4 compatibility: function pointer type checking fixes

1 participant