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 /spec/ruby | |
| parent | 3bb97e7707a0be8c371cb9c704cb1e21062e1fc6 (diff) | |
Add `NUM2PTR` and `PTR2NUM` macros
These macros have been defined here and there, so collect them.
Diffstat (limited to 'spec/ruby')
| -rw-r--r-- | spec/ruby/optional/capi/ext/digest_spec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/ext/digest_spec.c b/spec/ruby/optional/capi/ext/digest_spec.c index 9993238cf2..65c8defa20 100644 --- a/spec/ruby/optional/capi/ext/digest_spec.c +++ b/spec/ruby/optional/capi/ext/digest_spec.c @@ -135,7 +135,9 @@ VALUE digest_spec_context_size(VALUE self, VALUE meta) { return SIZET2NUM(algo->ctx_size); } +#ifndef PTR2NUM #define PTR2NUM(x) (rb_int2inum((intptr_t)(void *)(x))) +#endif VALUE digest_spec_context(VALUE self, VALUE digest) { return PTR2NUM(context); |
