ruby-changes:46829
From: naruse <ko1@a...>
Date: Mon, 29 May 2017 01:29:10 +0900 (JST)
Subject: [ruby-changes:46829] naruse:r58944 (trunk): Revert r58939 and r58942
naruse 2017-05-29 01:29:04 +0900 (Mon, 29 May 2017) New Revision: 58944 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58944 Log: Revert r58939 and r58942 This reverts following commits because it breaks mswinci * Update to ruby/spec@2a047c8 * Update to ruby/spec@ca32ae2 see also the result: http://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20170528T140014Z.fail.html.gz Added files: trunk/spec/rubyspec/optional/capi/ext/jruby.h trunk/spec/rubyspec/optional/capi/ext/rubinius.h trunk/spec/rubyspec/optional/capi/ext/truffleruby.h Modified files: trunk/spec/rubyspec/optional/capi/ext/rubyspec.h trunk/spec/rubyspec/optional/capi/spec_helper.rb Index: spec/rubyspec/optional/capi/spec_helper.rb =================================================================== --- spec/rubyspec/optional/capi/spec_helper.rb (revision 58943) +++ spec/rubyspec/optional/capi/spec_helper.rb (revision 58944) @@ -22,20 +22,21 @@ def compile_extension(name) https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/spec_helper.rb#L22 end ext = "#{name}_spec" + source = "#{extension_path}/#{ext}.c" lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}" ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h" return lib if File.exist?(lib) and - File.mtime(lib) > File.mtime("#{extension_path}/rubyspec.h") and - File.mtime(lib) > File.mtime("#{extension_path}/#{ext}.c") and + File.mtime(lib) > File.mtime(source) and File.mtime(lib) > File.mtime(ruby_header) and + File.mtime(lib) > File.mtime("#{extension_path}/rubyspec.h") and true # sentinel # Copy needed source files to tmpdir tmpdir = tmp("cext_#{name}") Dir.mkdir(tmpdir) begin - ["rubyspec.h", "#{ext}.c"].each do |file| + ["jruby.h", "rubinius.h", "truffleruby.h", "rubyspec.h", "#{ext}.c"].each do |file| cp "#{extension_path}/#{file}", "#{tmpdir}/#{file}" end @@ -57,7 +58,9 @@ def compile_extension(name) https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/spec_helper.rb#L58 raise "make failed:\n#{output}" unless $?.success? $stderr.puts output if debug - cp File.basename(lib), lib + Dir.glob("*.#{RbConfig::CONFIG['DLEXT']}") do |file| + cp file, "#{object_path}/#{file}" + end end ensure rm_r tmpdir Index: spec/rubyspec/optional/capi/ext/jruby.h =================================================================== --- spec/rubyspec/optional/capi/ext/jruby.h (nonexistent) +++ spec/rubyspec/optional/capi/ext/jruby.h (revision 58944) @@ -0,0 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/jruby.h#L1 +#ifndef RUBYSPEC_CAPI_JRUBY_H +#define RUBYSPEC_CAPI_JRUBY_H + +/* #undef any HAVE_ defines that JRuby does not have. */ +#undef HAVE_RB_DEFINE_HOOKED_VARIABLE +#undef HAVE_RB_DEFINE_VARIABLE + +#undef HAVE_RB_EXEC_RECURSIVE + +#endif Index: spec/rubyspec/optional/capi/ext/rubinius.h =================================================================== --- spec/rubyspec/optional/capi/ext/rubinius.h (nonexistent) +++ spec/rubyspec/optional/capi/ext/rubinius.h (revision 58944) @@ -0,0 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/rubinius.h#L1 +#ifndef RUBYSPEC_CAPI_RUBINIUS_H +#define RUBYSPEC_CAPI_RUBINIUS_H + +/* #undef any HAVE_ defines that Rubinius does not have. */ +#undef HAVE_RB_DEFINE_HOOKED_VARIABLE +#undef HAVE_RB_DEFINE_VARIABLE + +#endif Index: spec/rubyspec/optional/capi/ext/truffleruby.h =================================================================== --- spec/rubyspec/optional/capi/ext/truffleruby.h (nonexistent) +++ spec/rubyspec/optional/capi/ext/truffleruby.h (revision 58944) @@ -0,0 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/truffleruby.h#L1 +#ifndef RUBYSPEC_CAPI_TRUFFLERUBY_H +#undef RUBYSPEC_CAPI_TRUFFLERUBY_H + +// All features are available + +#endif Index: spec/rubyspec/optional/capi/ext/rubyspec.h =================================================================== --- spec/rubyspec/optional/capi/ext/rubyspec.h (revision 58943) +++ spec/rubyspec/optional/capi/ext/rubyspec.h (revision 58944) @@ -595,4 +595,19 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/rubyspec.h#L595 /* Util */ #define HAVE_RB_SCAN_ARGS 1 +/* Now, create the differential set. The format of the preprocessor directives + * is significant. The alternative implementations should define RUBY because + * some extensions depend on that. But only one alternative implementation + * macro should be defined at a time. The conditional is structured so that if + * no alternative implementation is defined then MRI is assumed. + */ + +#if defined(RUBINIUS) +#include "rubinius.h" +#elif defined(JRUBY) +#include "jruby.h" +#elif defined(TRUFFLERUBY) +#include "truffleruby.h" +#endif + #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/