mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/mkmf.rb (check_sizeof): fixed wrong recuring result for
intrinsic types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
15fabcb2db
commit
9a99663fa9
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri May 8 19:17:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/mkmf.rb (check_sizeof): fixed wrong recuring result for
|
||||
intrinsic types.
|
||||
|
||||
Fri May 8 10:14:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* Makefile.in, configure.in, win32/Makefile.sub (RUBY_BASE_NAME):
|
||||
|
|
12
lib/mkmf.rb
12
lib/mkmf.rb
|
@ -989,10 +989,14 @@ def check_sizeof(type, headers = nil, &b)
|
|||
x ? super : "failed"
|
||||
end
|
||||
checking_for checking_message("size of #{type}", headers), fmt do
|
||||
if ((size = UNIVERSAL_INTS.find {|t|
|
||||
try_static_assert("#{expr} == sizeof(#{t})", prelude, &b)
|
||||
}) or
|
||||
size = try_constant(expr, prelude, &b))
|
||||
if UNIVERSAL_INTS.include?(type)
|
||||
type
|
||||
elsif size = UNIVERSAL_INTS.find {|t|
|
||||
try_static_assert("#{expr} == sizeof(#{t})", prelude, opts, &b)
|
||||
}
|
||||
$defs.push(format("-DSIZEOF_%s=SIZEOF_%s", type.tr_cpp, size.tr_cpp))
|
||||
size
|
||||
elsif size = try_constant(expr, prelude, opts, &b)
|
||||
$defs.push(format("-DSIZEOF_%s=%s", type.tr_cpp, size))
|
||||
size
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue