1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/dbm/extconf.rb: use convertible_int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-11-13 14:47:31 +00:00
parent a0146d1e87
commit 416778c5d8
3 changed files with 7 additions and 10 deletions

View file

@ -1,3 +1,7 @@
Sun Nov 13 23:47:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dbm/extconf.rb: use convertible_int.
Sun Nov 13 23:45:57 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (checking_for): should not modify the result.

View file

@ -21,12 +21,11 @@
#include <fcntl.h>
#include <errno.h>
#if SIZEOF_DSIZE > SIZEOF_INT
# define DSIZE_TYPE long
#define DSIZE_TYPE TYPEOF_DATUM_DSIZE
#if SIZEOF_DATUM_DSIZE > SIZEOF_INT
# define RSTRING_DSIZE(s) RSTRING_LEN(s)
# define TOO_LONG(n) 0
#else
# define DSIZE_TYPE int
# define RSTRING_DSIZE(s) RSTRING_LENINT(s)
# define TOO_LONG(n) ((long)(+(DSIZE_TYPE)(n)) != (n))
#endif

View file

@ -71,12 +71,6 @@ if dblib.any? {|db| headers.fetch(db, ["ndbm.h"]).any? {|hdr| headers.db_check(d
have_header("sys/cdefs.h")
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, headers.defs)
end
end
$defs << "-DSIZEOF_DSIZE=SIZEOF_"+type.tr_cpp if type
convertible_int("datum.dsize", headers.found, headers.defs)
create_makefile("dbm")
end