Top Level Namespace
Defined Under Namespace
Modules: BigMath, Jacobian, Kernel, LUSolve, Newton
Classes: BigDecimal, Complex, Float, Integer, NilClass, Rational, String
Instance Method Summary
collapse
Instance Method Details
#check_bigdecimal_version(gemspec_path) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
|
# File 'ext/bigdecimal/extconf.rb', line 4
def check_bigdecimal_version(gemspec_path)
message "checking RUBY_BIGDECIMAL_VERSION... "
bigdecimal_version = File.read(gemspec_path).match(/^\s*s\.version\s+=\s+['"]([^'"]+)['"]\s*$/)[1]
version_components = bigdecimal_version.split('.')
bigdecimal_version = version_components[0, 3].join('.')
bigdecimal_version << "-#{version_components[3]}" if version_components[3]
$defs << %Q[-DRUBY_BIGDECIMAL_VERSION=\\"#{bigdecimal_version}\\"]
message "#{bigdecimal_version}\n"
end
|
#have_builtin_func(name, check_expr, opt = "", &b) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'ext/bigdecimal/extconf.rb', line 16
def have_builtin_func(name, check_expr, opt = "", &b)
checking_for checking_message(name.funcall_style, nil, opt) do
if try_compile("int foo;\nint main() { \#{check_expr}; return 0; }\n", opt, &b)
$defs.push(format("-DHAVE_BUILTIN_%s", name.tr_cpp))
true
else
false
end
end
end
|