Top Level Namespace

Defined Under Namespace

Classes: DBM, DBMError

Instance Method Summary collapse

Instance Method Details

#have_declared_libvar(var, headers = nil, opt = "", &b) ⇒ Object


59
60
61
62
63
# File 'extconf.rb', line 59

def have_declared_libvar(var, headers = nil, opt = "", &b)
  checking_for checking_message([*var].compact.join(' '), headers, opt) do
    try_declared_libvar(var, headers, opt, &b)
  end
end

#have_empty_macro_dbm_clearerr(headers = nil, opt = "", &b) ⇒ Object


106
107
108
109
110
111
# File 'extconf.rb', line 106

def have_empty_macro_dbm_clearerr(headers = nil, opt = "", &b)
  checking_for checking_message('empty macro of dbm_clearerr(foobarbaz)',
                                headers, opt) do
    try_toplevel('dbm_clearerr(foobarbaz)', headers, opt, &b)
  end
end

#have_undeclared_libvar(var, headers = nil, opt = "", &b) ⇒ Object


81
82
83
84
85
# File 'extconf.rb', line 81

def have_undeclared_libvar(var, headers = nil, opt = "", &b)
  checking_for checking_message([*var].compact.join(' '), headers, opt) do
    try_undeclared_libvar(var, headers, opt, &b)
  end
end

#try_declared_libvar(var, headers = nil, opt = "", &b) ⇒ Object


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'extconf.rb', line 65

def try_declared_libvar(var, headers = nil, opt = "", &b)
  if try_link("\#{cpp_include(headers)}\n/*top*/\nint main(int argc, char *argv[]) {\n  void *conftest_var = &\#{var};\n  return 0;\n}\n", opt, &b)
    $defs.push(format("-DHAVE_DECLARED_LIBVAR_%s", var.tr_cpp))
    true
  else
    false
  end
end

#try_toplevel(src, headers = nil, opt = "", &b) ⇒ Object


113
114
115
116
117
118
119
120
121
122
123
# File 'extconf.rb', line 113

def try_toplevel(src, headers = nil, opt = "", &b)
  if try_compile("\#{cpp_include(headers)}\n/*top*/\n\#{src}\n", opt, &b)
    true
  else
    false
  end
end

#try_undeclared_libvar(var, headers = nil, opt = "", &b) ⇒ Object


87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'extconf.rb', line 87

def try_undeclared_libvar(var, headers = nil, opt = "", &b)
  var, type = *var
  if try_link("\#{cpp_include(headers)}\n/*top*/\nint main(int argc, char *argv[]) {\n  typedef \#{type || 'int'} conftest_type;\n  extern conftest_type \#{var};\n  conftest_type *conftest_var = &\#{var};\n  return 0;\n}\n", opt, &b)
    $defs.push(format("-DHAVE_UNDECLARED_LIBVAR_%s", var.tr_cpp))
    true
  else
    false
  end
end