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(<