APIdock / Ruby
/
method

try_const

ruby latest stable - Class: Object

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_3_392) is shown here.

try_const(const, headers = nil, opt = "", &b)
public

Returns whether or not the Constant const is defined.

See also have_const

# File lib/mkmf.rb, line 1078
def try_const(const, headers = nil, opt = "", &b)
 const, type = *const
 if try_compile(#{cpp_include(headers)}/*top*/typedef #{type || 'int'} conftest_type;conftest_type conftestval = #{type ? '' : '(int)'}#{const};, opt, &b)
 $defs.push(format("-DHAVE_CONST_%s", const.tr_cpp))
 true
 else
 false
 end
end

AltStyle によって変換されたページ (->オリジナル) /