summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-20 08:02:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-20 08:02:11 +0000
commit2027b84927ccae23e6c0fc194413a16ce69c59b9 (patch)
treebcd483d8b4232a4315d162651d102ff116206945 /lib/mkmf.rb
parenta6d288e1585367cd6ded3fb4b30e002578080b68 (diff)
* lib/mkmf.rb (check_sizeof): define result size. [ruby-core:02911]
* lib/mkmf.rb (create_header): macro name should not include equal sign. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index ed0203b9ca..0f701e0a05 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -578,7 +578,7 @@ def check_sizeof(type, header = nil, &b)
message "%s", m
Logging::message "check_sizeof: %s--------------------\n", m
if size = try_constant(expr, header, &b)
- $defs.push(format("-DSIZEOF_%s", type.upcase.tr_s("^A-Z0-9_", "_")))
+ $defs.push(format("-DSIZEOF_%s=%d", type.upcase.tr_s("^A-Z0-9_", "_"), size))
end
message(a = size ? "#{size}\n" : "failed\n")
Logging::message "-------------------- %s\n", a
@@ -631,7 +631,7 @@ def create_header(header = "extconf.h")
hfile.print "#ifndef #{sym}\n#define #{sym}\n"
for line in $defs
case line
- when /^-D(.*)(?:=(.*))?/
+ when /^-D([^=]+)(?:=(.*))?/
hfile.print "#define #$1 #{$2 || 1}\n"
when /^-U(.*)/
hfile.print "#undef #$1\n"