Skip to content

Commit

Permalink
Refactor so RDoc picks up RbConfig::{SIZEOF,LIMITS}
Browse files Browse the repository at this point in the history
  • Loading branch information
XrXr committed Jul 12, 2024
1 parent 84138f5 commit a97c2ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion template/limits.c.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ void
Init_limits(void)
{
VALUE h = rb_hash_new();
rb_define_const(rb_define_module("RbConfig"), "LIMITS", h);
VALUE mRbConfig = rb_define_module("RbConfig");
rb_define_const(mRbConfig, "LIMITS", h);

#ifdef HAVE_LONG_LONG
#ifndef ULLONG_MAX
Expand Down
3 changes: 2 additions & 1 deletion template/sizes.c.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ void
Init_sizeof(void)
{
VALUE s = rb_hash_new();
rb_define_const(rb_define_module("RbConfig"), "SIZEOF", s);
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)))
Expand Down

0 comments on commit a97c2ce

Please sign in to comment.