From: Nobuyoshi Nakada Date: 2011-11-17T22:42:40+09:00 Subject: [ruby-core:41106] Re: [ruby-core:41093] Re: [ruby-core:41092] Re: Why doesn’t mkmf’s have_macro add a HAVE_X to $defs? Hi, At Thu, 17 Nov 2011 16:18:33 +0900, Nikolai Weibull wrote in [ruby-core:41093]: > > You can simply use "#ifdef X". Why do you need a macro just > > tells if another macro is defined? > > True, but I wanted to simplify my checks for rb_long2int, which can be > either a macro or a function. It's indeed my bad. In 2.0, I had already changed rb_long2int a macro regardless the size of long. But it was late. Also, have_func in 2.0 can check the function with arguments. > I guess > #if defined(HAVE_RB_LONG2INT) || defined(rb_long2int) > > isn���t as bad as I initially thought. Or, for this specific purpose, you can check if RSTRING_LENINT (or RARRAY_LENINT) is defined instead. -- Nobu Nakada