From a97c2cedaa553a8328a6a9f97fe0844dff4f2e41 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Fri, 12 Jul 2024 19:32:38 -0400 Subject: [PATCH] Refactor so RDoc picks up RbConfig::{SIZEOF,LIMITS} --- template/limits.c.tmpl | 3 ++- template/sizes.c.tmpl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/template/limits.c.tmpl b/template/limits.c.tmpl index de35354829478f..c3c2a47624bfb2 100644 --- a/template/limits.c.tmpl +++ b/template/limits.c.tmpl @@ -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 diff --git a/template/sizes.c.tmpl b/template/sizes.c.tmpl index 31060f5fea676d..d1cdbc095f6cbd 100644 --- a/template/sizes.c.tmpl +++ b/template/sizes.c.tmpl @@ -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)))