APIdock / Ruby
/
method

have_func

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_func(func, headers = nil, &b)
public

Returns whether or not the function func can be found in the common header files, or within any headers that you provide. If found, a macro is passed as a preprocessor constant to the compiler using the function name, in uppercase, prepended with ‘HAVE_’.

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

# File lib/mkmf.rb, line 892
def have_func(func, headers = nil, &b)
 checking_for checking_message("#{func}()", headers) do
 if try_func(func, $libs, headers, &b)
 $defs.push(format("-DHAVE_%s", func.tr_cpp))
 true
 else
 false
 end
 end
end

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