From a6fa5855a864a69466556182d429a5c2ab2651bb Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 Apr 2009 05:00:07 +0000 Subject: * lib/mkmf.rb (what_type?): fixed typo, and refined for member of aggregation types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mkmf.rb | 76 +++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 25 deletions(-) (limited to 'lib/mkmf.rb') diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 63c6007c34..bc84708719 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -989,8 +989,7 @@ def check_sizeof(type, headers = nil, &b) x ? super : "failed" end checking_for checking_message("size of #{type}", headers), fmt do - if (($universal and - size = UNIVERSAL_INTS.find {|t| + if ((size = UNIVERSAL_INTS.find {|t| try_static_assert("#{expr} == sizeof(#{t})", prelude, &b) }) or size = try_constant(expr, prelude, &b)) @@ -1026,48 +1025,74 @@ int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));} SRC end +# Used internally by the what_type? method to check if _typeof_ GCC +# extension is available. +def have_typeof? + return $typeof if defined?($typeof) + $typeof = %w[__typeof__ typeof].find do |t| + try_compile(<