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



42
43
44
45
46
# File 'extconf.rb', line 42

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



89
90
91
92
93
94
# File 'extconf.rb', line 89

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



64
65
66
67
68
# File 'extconf.rb', line 64

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



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'extconf.rb', line 48

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

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



96
97
98
99
100
101
102
103
104
105
106
# File 'extconf.rb', line 96

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

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'extconf.rb', line 70

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