Top Level Namespace

Defined Under Namespace

Modules: JSON, Kernel Classes: BigDecimal, Complex, Date, DateTime, Exception, Object, OpenStruct, Range, Rational, Regexp, Set, String, Struct, Symbol, Time

Instance Method Summary collapse

Instance Method Details

#have_builtin_func(name, check_expr, opt = "", &b) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'ext/json/ext/parser/extconf.rb', line 18

def have_builtin_func(name, check_expr, opt = "", &b)
  checking_for checking_message(name.funcall_style, nil, opt) do
    if try_compile(<<SRC, opt, &b)
int foo;
int main() { #{check_expr}; return 0; }
SRC
      $defs.push(format("-DHAVE_BUILTIN_%s", name.tr_cpp))
      true
    else
      false
    end
  end
end