Project

General

Profile

« Previous | Next » 

Revision 4b33b468

Added by mame (Yusuke Endoh) 6 months ago

Fix function pointer type mismatch with rb_define_private_method

rb_define_private_method performs strict type checking on the function
pointer. As a result, we cannot pass the function a generic signature.

  /github/workspace/src/namespace.c:1097:72: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long unsigned int (*)(int,  long unsigned int *, long unsigned int)'}
   1097 | namespace_define_loader_method(VALUE module, const char *name, VALUE (*func)(ANYARGS), int argc)
        |                                                                ~~~~~~~~^~~~~~~~~~~~~~

This commit defines the method directly to avoid the mismatch error.