ruby-changes:21650
From: nobu <ko1@a...>
Date: Thu, 10 Nov 2011 15:43:58 +0900 (JST)
Subject: [ruby-changes:21650] nobu:r33698 (trunk): * ext/dbm/extconf.rb: check for dsize as LONG_LONG.
nobu 2011-11-10 15:43:44 +0900 (Thu, 10 Nov 2011) New Revision: 33698 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33698 Log: * ext/dbm/extconf.rb: check for dsize as LONG_LONG. Modified files: trunk/ext/dbm/extconf.rb Index: ext/dbm/extconf.rb =================================================================== --- ext/dbm/extconf.rb (revision 33697) +++ ext/dbm/extconf.rb (revision 33698) @@ -61,10 +61,12 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/