diff options
Diffstat (limited to 'ext/dbm/extconf.rb')
-rw-r--r-- | ext/dbm/extconf.rb | 10 |
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 |