summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-20 03:22:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-20 03:22:20 +0000
commit41e4c5de36fc9005a65320c39ce07c74b747222c (patch)
treeedbd2598ba24c85578df6c77736d18cc2c543274 /lib
parent6988d86035f8063bd3c1228573523ed700405cf5 (diff)
* lib/mkmf.rb (have_type): do not check pointer to incomplete type,
which always get compiled. [ruby-list:39683] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index ddcb53d528..c8e98fb4ed 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -574,7 +574,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*/
@@ -585,7 +585,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