Skip to content

Commit

Permalink
Make rbconfig/sizeof keys US-ASCII
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Oct 7, 2024
1 parent dbb1aba commit 67591b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion template/limits.c.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions template/sizes.c.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 67591b5

Please sign in to comment.