aboutsummaryrefslogtreecommitdiffstats
path: root/ext/dbm/extconf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-10 06:43:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-10 06:43:44 +0000
commitfb1836ab4854d5da9f4600ef9053cae95f7ca577 (patch)
tree3c6d3de93a957f232e1f13af1b91770642a1013b /ext/dbm/extconf.rb
parentfc5f37f0e1cda9afc108e2bed5676714cb7d7028 (diff)
downloadruby-fb1836ab4854d5da9f4600ef9053cae95f7ca577.tar.gz
* ext/dbm/extconf.rb: check for dsize as LONG_LONG.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm/extconf.rb')
-rw-r--r--ext/dbm/extconf.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 419ea65163..6d1de2ee66 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -61,10 +61,12 @@ if dblib.any? {|db| headers.db_check(db)}
have_header("sys/cdefs.h")
have_func("dbm_pagfno", headers.found)
have_func("dbm_dirfno", headers.found)
- if try_static_assert("sizeof(conftest_key.dsize) <= sizeof(int)", [[cpp_include(headers.found), "static datum conftest_key;"]])
- $defs << "-DSIZEOF_DSIZE=SIZEOF_INT"
- else
- $defs << "-DSIZEOF_DSIZE=SIZEOF_LONG"
+ type = checking_for "sizeof(datum.dsize)", STRING_OR_FAILED_FORMAT do
+ pre = headers.found + [["static datum conftest_key;"]]
+ %w[int long LONG_LONG].find do |t|
+ try_static_assert("sizeof(conftest_key.dsize) <= sizeof(#{t})", pre)
+ end
end
+ $defs << "-DSIZEOF_DSIZE=SIZEOF_"+type.tr_cpp if type
create_makefile("dbm")
end