1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/mkmf.rb (check_sizeof): added optional compiler option

argument.  [ruby-core:24785]

* lib/mkmf.rb (create_makefile): suppressed shadowing outer local
  variable warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-08-06 04:00:38 +00:00
parent d04b691b96
commit c6ada1e7e0
3 changed files with 44 additions and 7 deletions

27
test/mkmf/test_sizeof.rb Normal file
View file

@ -0,0 +1,27 @@
require 'test/unit'
require 'mkmf'
require 'tmpdir'
$extout = '$(topdir)/'+RbConfig::CONFIG["EXTOUT"]
RbConfig::CONFIG['topdir'] = CONFIG['topdir'] = File.expand_path(CONFIG['topdir'])
RbConfig::CONFIG["extout"] = CONFIG["extout"] = $extout
$extout_prefix = "$(extout)$(target_prefix)/"
class TestMkmf < Test::Unit::TestCase
def setup
@tmpdir = Dir.mktmpdir
@mkmfobj = Object.new
end
def mkmf(*args, &block)
@mkmfobj.instance_eval(*args, &block)
end
def test_sizeof
Dir.chdir(@tmpdir) do
open("confdefs.h", "w") {|f|
f.puts "typedef struct {char x;} test1_t;"
}
mkmf {check_sizeof("test1_t", "confdefs.h")} rescue puts File.read("mkmf.log")
end
end
end