summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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 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