diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-12-10 12:09:50 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-12-10 12:09:50 +0900 |
| commit | 3636277dc5837bcedcd5ef43d49423194064a676 (patch) | |
| tree | 8d50cad7d133de530580817345e3ec430464c4e0 /load.c | |
| parent | 3bb97e7707a0be8c371cb9c704cb1e21062e1fc6 (diff) | |
Add `NUM2PTR` and `PTR2NUM` macros
These macros have been defined here and there, so collect them.
Diffstat (limited to 'load.c')
| -rw-r--r-- | load.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1345,7 +1345,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa reset_ext_config = true; ext_config_push(th, &prev_ext_config); handle = rb_vm_call_cfunc_in_box(box->top_self, load_ext, path, fname, path, box); - rb_hash_aset(box->ruby_dln_libmap, path, SVALUE2NUM((SIGNED_VALUE)handle)); + rb_hash_aset(box->ruby_dln_libmap, path, PTR2NUM(handle)); break; } result = TAG_RETURN; @@ -1666,7 +1666,7 @@ rb_ext_resolve_symbol(const char* fname, const char* symbol) if (NIL_P(handle)) { return NULL; } - return dln_symbol((void *)NUM2SVALUE(handle), symbol); + return dln_symbol(NUM2PTR(handle), symbol); } void |
