diff --git a/ChangeLog b/ChangeLog index 5885507bb5..d57c03bfde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Nov 11 21:00:05 2011 Tanaka Akira + + * ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with + Berkeley DB. Macro definitions needs arguments to detect correctly. + SIZEOF_DSIZE needs -DDB_DBM_HSEARCH because db.h defines datum type + only if DB_DBM_HSEARCH is defined. + Fri Nov 11 18:41:57 2011 Nobuyoshi Nakada * process.c (proc_seteuid): separate an internal wrapper function diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb index fb722a3c39..608f4d472f 100644 --- a/ext/dbm/extconf.rb +++ b/ext/dbm/extconf.rb @@ -64,12 +64,12 @@ end if dblib.any? {|db| headers.db_check(db)} have_header("cdefs.h") have_header("sys/cdefs.h") - have_func("dbm_pagfno", headers.found, headers.defs) - have_func("dbm_dirfno", headers.found, headers.defs) + have_func("dbm_pagfno((DBM *)0)", headers.found, headers.defs) + have_func("dbm_dirfno((DBM *)0)", headers.found, headers.defs) 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) + try_static_assert("sizeof(conftest_key.dsize) <= sizeof(#{t})", pre, headers.defs) end end $defs << "-DSIZEOF_DSIZE=SIZEOF_"+type.tr_cpp if type