diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-10-07 18:45:07 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-10-07 18:45:07 +0900 |
commit | dbb1abacf0538db61496cd25d9616dfa18327cd9 () | |
tree | a988b85435d71585d035b4a996911c16214173f1 /template | |
parent | 66b69d4ea553485306b683d7f965181dffca5205 (diff) |
Make rbconfig/sizeof keys as literals
These keys are made from string literals, and used only as keys of hashes.
Notes: Merged: https://.com/ruby/ruby/pull/11814
-rw-r--r-- | template/limits.c.tmpl | 2 | ||||
-rw-r--r-- | template/sizes.c.tmpl | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -82,7 +82,7 @@ Init_limits(void) #define MAX2NUM(name) ULONG2NUM(name ## _MAX) #define MIN2NUM(name) LONG2NUM(name ## _MIN) #endif -#define DEFINE(k, v) rb_hash_aset(h, rb_str_new_cstr(#k), v) % limits.each do |type| #ifdef <%= type %>_MAX @@ -47,8 +47,8 @@ Init_sizeof(void) VALUE mRbConfig = rb_define_module("RbConfig"); rb_define_const(mRbConfig, "SIZEOF", s); -#define DEFINE(type, size) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size)) -#define DEFINE_SIZE(type) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(sizeof(type))) % types.each do |type| % if sizes[type] |