summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-08 10:17:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-08 10:17:04 +0000
commit1ace8956ca29cd5952b37039f33ad65152271033 (patch)
tree7cf6247480ec7e452101c1f22293271e1274a48b /lib
parent240e3ce9159ab29636baf2d0c79d9bb6f0b60b19 (diff)
downloadruby-1ace8956ca29cd5952b37039f33ad65152271033.tar.gz
ruby-1ace8956ca29cd5952b37039f33ad65152271033.tar.xz
ruby-1ace8956ca29cd5952b37039f33ad65152271033.zip
* lib/mkmf.rb (check_sizeof): fixed wrong recuring result for
intrinsic types. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d24c87f5c..45346bfdb 100644
--- a/lib/mkmf.rb
+++ b/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