From a6fa5855a864a69466556182d429a5c2ab2651bb Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 Apr 2009 05:00:07 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++- lib/mkmf.rb | 76 +++++++++++++++++++++++++++++++++++------------------ 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 504d0a9c56..090f42a1a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Wed Apr 8 13:57:56 2009 Nobuyoshi Nakada +Wed Apr 8 14:00:04 2009 Nobuyoshi Nakada + + * lib/mkmf.rb (what_type?): fixed typo, and refined for member of + aggregation types. * lib/mkmf.rb (Logging.postpone): copy postponed output always. 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(<