mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3b6992be67
commit
15df6bd4f7
2 changed files with 20 additions and 6 deletions
|
@ -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.
|
||||
|
||||
Wed Mar 23 19:08:10 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* lib/webrick/utils.rb (WEBrick::Utils.create_listeners):
|
||||
|
|
19
lib/mkmf.rb
19
lib/mkmf.rb
|
@ -458,10 +458,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
|
||||
|
@ -688,12 +689,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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue