summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-10-08 15:44:40 +0900
committerNobuyoshi Nakada <[email protected]>2024-10-08 23:29:49 +0900
commit49ccc31d906d26f980dcedf1197a2e18245ec50e ()
treeceddfe4773f84f6b3f5f2f90c6d196fbfe621305 /vm_insnhelper.c
parent9a90cd228466ec088d6f0da8d1aa065f03daa7c8 (diff)
Add a macro to initialize union `cfunc_type`
``` vm_insnhelper.c:2430:49: error: ISO C prohibits argument conversion to union type [-Wpedantic] 2430 | if (!vm_method_cfunc_is(cd_owner, cd, recv, rb_obj_equal)) { | ^~~~~~~~~~~~ vm_insnhelper.c:2448:42: error: ISO C prohibits argument conversion to union type [-Wpedantic] 2448 | if (cc && check_cfunc(vm_cc_cme(cc), rb_obj_equal)) { | ^~~~~~~~~~~~ ``` and so on.
-rw-r--r--vm_insnhelper.c5
1 files changed, 5 insertions, 0 deletions
@@ -2309,8 +2309,10 @@ typedef union {
VALUE (*f15)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
VALUE (*fm1)(int, union { VALUE *x; const VALUE *y; } __attribute__((__transparent_union__)), VALUE);
} __attribute__((__transparent_union__)) cfunc_type;
#else
typedef VALUE (*cfunc_type)(ANYARGS);
#endif
static inline int
@@ -2344,6 +2346,9 @@ vm_method_cfunc_is(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv, cfunc_type f
return check_cfunc(vm_cc_cme(cc), func);
}
#define EQ_UNREDEFINED_P(t) BASIC_OP_UNREDEFINED_P(BOP_EQ, t##_REDEFINED_OP_FLAG)
static inline bool