From 791688c729764daefba88a0f34f3cdd399c39347 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 20 May 2004 03:22:20 +0000 Subject: * lib/mkmf.rb (have_type): do not check pointer to incomplete type, which always get compiled. [ruby-list:39683] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mkmf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/mkmf.rb b/lib/mkmf.rb index a6d1413b1..3f4dcd814 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -553,7 +553,7 @@ end def have_type(type, header = nil, opt = "", &b) checking_for type do header = cpp_include(header) - if try_compile(<<"SRC", opt, &b) or try_compile(<<"SRC", opt, &b) + if try_compile(<<"SRC", opt, &b) or (/\A\w+\z/n =~ type && try_compile(<<"SRC", opt, &b)) #{COMMON_HEADERS} #{header} /*top*/ @@ -564,7 +564,7 @@ SRC /*top*/ static #{type} *t; SRC - $defs.push(format("-DHAVE_TYPE_%s", type.upcase.tr_s("^A-Z0-9_", "_"))) + $defs.push(format("-DHAVE_TYPE_%s", type.strip.upcase.tr_s("^A-Z0-9_", "_"))) true else false -- cgit