From 67591b545ce2b4c15bcf9ef813576954d7e2bf4f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 7 Oct 2024 19:20:08 +0900 Subject: [PATCH] Make rbconfig/sizeof keys US-ASCII --- template/limits.c.tmpl | 2 +- template/sizes.c.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/template/limits.c.tmpl b/template/limits.c.tmpl index a46cf5ed63..f7867ded9a 100644 --- a/template/limits.c.tmpl +++ b/template/limits.c.tmpl @@ -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_lit(#k), v) +#define DEFINE(k, v) rb_hash_aset(h, rb_usascii_str_new_lit(#k), v) % limits.each do |type| #ifdef <%= type %>_MAX diff --git a/template/sizes.c.tmpl b/template/sizes.c.tmpl index d44ef378fe..abc3b5c908 100644 --- a/template/sizes.c.tmpl +++ b/template/sizes.c.tmpl @@ -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_lit(#type), INT2FIX(SIZEOF_##size)) -#define DEFINE_SIZE(type) rb_hash_aset(s, rb_str_new_lit(#type), INT2FIX(sizeof(type))) +#define DEFINE(type, size) rb_hash_aset(s, rb_usascii_str_new_lit(#type), INT2FIX(SIZEOF_##size)) +#define DEFINE_SIZE(type) rb_hash_aset(s, rb_usascii_str_new_lit(#type), INT2FIX(sizeof(type))) % types.each do |type| % if sizes[type]