summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/mkmf.rb19
2 files changed, 20 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 01cc507045..8d4cd21f15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Mar 24 23:10:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (macro_defined?): try to compile for an old compiler
+ which doesn't bail out at #error directive. [ruby-dev:25818]
+
+ * lib/mkmf.rb (check_sizeof): refine logging messages.
+
Thu Mar 24 03:57:48 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/utils.rb (WEBrick::Utils.create_listeners):
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 5263c4b07b..5c4917c944 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -407,10 +407,11 @@ end
def macro_defined?(macro, src, opt = "", &b)
src = src.sub(/[^\n]\z/, "\\&\n")
- try_cpp(src + <<"SRC", opt, &b)
+ try_compile(src + <<"SRC", opt, &b)
/*top*/
#ifndef #{macro}
# error
+>>>>>> #{macro} undefined <<<<<<
#endif
SRC
end
@@ -618,12 +619,18 @@ def check_sizeof(type, header = nil, &b)
expr = "sizeof(#{type})"
m = "checking size of #{type}... "
message "%s", m
- Logging::message "check_sizeof: %s--------------------\n", m
- if size = try_constant(expr, header, &b)
- $defs.push(format("-DSIZEOF_%s=%d", type.upcase.tr_s("^A-Z0-9_", "_"), size))
+ a = size = nil
+ Logging::postpone do
+ if size = try_constant(expr, header, &b)
+ $defs.push(format("-DSIZEOF_%s=%d", type.upcase.tr_s("^A-Z0-9_", "_"), size))
+ a = "#{size}\n"
+ else
+ a = "failed\n"
+ end
+ "check_sizeof: #{m}-------------------- #{a}\n"
end
- message(a = size ? "#{size}\n" : "failed\n")
- Logging::message "-------------------- %s\n", a
+ message(a)
+ Logging::message "--------------------\n\n"
size
end