From fb1836ab4854d5da9f4600ef9053cae95f7ca577 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 10 Nov 2011 06:43:44 +0000 Subject: * 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 --- ext/dbm/extconf.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/dbm') 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 -- cgit v1.2.3