Merge pull request #2166 from take-cheeze/fix_for_1_8

Remove use of define_singleton_method.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-05-02 00:17:52 +09:00
+4 -3
View File
@@ -30,10 +30,11 @@ MRuby::Toolchain.new(:gcc) do |conf|
end
[[conf.cc, 'c'], [conf.cxx, 'c++']].each do |cc, lang|
cc.define_singleton_method(:header_search_paths) do
cc.instance_variable_set :@header_search_language, lang
def cc.header_search_paths
if @header_search_command != command
result = `echo | #{build.filename command} -x#{lang} -Wp,-v - -fsyntax-only 2>&1`
result = `echo | #{command} -x#{lang} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0
result = `echo | #{build.filename command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1`
result = `echo | #{command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0
return include_paths if $?.exitstatus != 0
@frameworks = []