APIdock / Ruby
/
method

have_header

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.

have_header(header, preheaders = nil, &b)
public

Returns whether or not the given header file can be found on your system. If found, a macro is passed as a preprocessor constant to the compiler using the header file name, in uppercase, prepended with ‘HAVE_’.

For example, if have_header(‘foo.h’) returned true, then the HAVE_FOO_H preprocessor macro would be passed to the compiler.

# File lib/mkmf.rb, line 929
def have_header(header, preheaders = nil, &b)
 checking_for header do
 if try_header(cpp_include(preheaders)+cpp_include(header), &b)
 $defs.push(format("-DHAVE_%s", header.tr_cpp))
 true
 else
 false
 end
 end
end

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