Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
MakeMakefile#try_type
try_type(type, headers = nil, opt = "", &b)
lib/mkmf.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/mkmf.rb, line 1256
def try_type(type, headers = nil, opt = "", &b)
if try_compile(<<"SRC", opt, &b)
#{cpp_include(headers)}
/*top*/
typedef #{type} conftest_type;
int conftestval[sizeof(conftest_type)?1:-1];
SRC
$defs.push(format("-DHAVE_TYPE_%s", type.tr_cpp))
true
else
false
end
end
Returns whether or not the static type type is defined.
See also have_type