Skip to content
Browse files

Split C-API headers for 1.8/1.9.

  • Loading branch information...
1 parent 23af0f7 commit 33c8f28490f4ff88c8ed4e83e1a85e47181c5f86 @brixen brixen committed
Showing with 1,954 additions and 66 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 bin/rbx-build
  3. +20 −7 configure
  4. +1 −1 lib/mkmf.rb
  5. +10 −1 lib/rbconfig.rb
  6. +13 −3 rakelib/ext_helper.rb
  7. +3 −2 rakelib/extensions.rake
  8. +6 −4 spec/library/config/rbconfig_spec.rb
  9. +1 −0 vm/capi/18/include/config.h
  10. +20 −0 vm/capi/18/include/defines.h
  11. +1 −0 vm/capi/18/include/dl.h
  12. +1 −0 vm/capi/18/include/intern.h
  13. +1 −0 vm/capi/18/include/missing.h
  14. +1 −0 vm/capi/18/include/rbx_config.h
  15. +1 −0 vm/capi/18/include/rbxti.hpp
  16. +1 −0 vm/capi/18/include/re.h
  17. 0 vm/capi/{ → 18}/include/ruby.h
  18. +1 −0 vm/capi/18/include/rubyio.h
  19. +1 −0 vm/capi/18/include/rubysig.h
  20. +1 −0 vm/capi/18/include/st.h
  21. +1 −0 vm/capi/18/include/util.h
  22. +7 −0 vm/capi/{ → 18}/include/version.h
  23. +1 −0 vm/capi/19/include/config.h
  24. 0 vm/capi/{ → 19}/include/defines.h
  25. +1 −0 vm/capi/19/include/dl.h
  26. +1 −0 vm/capi/19/include/intern.h
  27. +1 −0 vm/capi/19/include/missing.h
  28. +1 −0 vm/capi/19/include/rbx_config.h
  29. +1 −0 vm/capi/19/include/rbxti.hpp
  30. +1 −0 vm/capi/19/include/re.h
  31. +1,773 −0 vm/capi/19/include/ruby.h
  32. 0 vm/capi/{ → 19}/include/ruby/encoding.h
  33. 0 vm/capi/{ → 19}/include/ruby/oniguruma.h
  34. +1 −0 vm/capi/19/include/rubyio.h
  35. +1 −0 vm/capi/19/include/rubysig.h
  36. +1 −0 vm/capi/19/include/st.h
  37. +1 −0 vm/capi/19/include/util.h
  38. +10 −0 vm/capi/19/include/version.h
  39. +1 −1 vm/capi/array.cpp
  40. +1 −1 vm/capi/bignum.cpp
  41. +1 −1 vm/capi/capi.cpp
  42. +1 −1 vm/capi/class.cpp
  43. +1 −1 vm/capi/data.cpp
  44. +3 −3 vm/capi/encoding.cpp
  45. +1 −1 vm/capi/exception.cpp
  46. +1 −1 vm/capi/float.cpp
  47. +1 −1 vm/capi/gc.cpp
  48. +1 −1 vm/capi/globals.cpp
  49. +1 −1 vm/capi/handle.cpp
  50. +1 −1 vm/capi/hash.cpp
  51. +0 −1 vm/capi/include/ruby/st.h
  52. +1 −1 vm/capi/io.cpp
  53. +1 −1 vm/capi/kernel.cpp
  54. +1 −1 vm/capi/marshal.cpp
  55. +1 −1 vm/capi/module.cpp
  56. +1 −1 vm/capi/numeric.cpp
  57. +1 −1 vm/capi/object.cpp
  58. +1 −1 vm/capi/proc.cpp
  59. +1 −1 vm/capi/range.cpp
  60. +1 −1 vm/capi/regexp.cpp
  61. +1 −14 vm/capi/string.cpp
  62. +33 −0 vm/capi/string19.cpp
  63. +1 −1 vm/capi/struct.cpp
  64. +1 −1 vm/capi/symbol.cpp
  65. +1 −1 vm/capi/thread.cpp
  66. +1 −1 vm/capi/time.cpp
  67. +1 −1 vm/capi/util.cpp
  68. +3 −1 vm/ontology.cpp
  69. +1 −1 vm/test/capi/test_constants.hpp
  70. +1 −1 vm/test/capi/test_handles.hpp
View
2 Rakefile
@@ -33,7 +33,7 @@ end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG
-unless BUILD_CONFIG[:config_version] == 130
+unless BUILD_CONFIG[:config_version] == 131
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
View
2 bin/rbx-build
@@ -5,6 +5,6 @@ BASE_DIR=$(dirname $BIN_DIR)
export RBX_RUNTIME="$BASE_DIR/runtime"
export RBX_LIB="$BASE_DIR/lib"
-export RBX_CAPI_DIR="$BASE_DIR/vm/capi/include"
+export RBX_CAPI_DIR="$BASE_DIR/vm/capi/18/include"
exec $BIN_DIR/../vm/vm "$*"
View
27 configure
@@ -86,7 +86,9 @@ class Configure
# File system paths
@bindir = root + "/bin"
- @includedir = root + "/vm/capi/include"
+ @include18dir = root + "/vm/capi/18/include"
+ @include19dir = root + "/vm/capi/19/include"
+ @include20dir = root + "/vm/capi/19/include"
@libdir = root
@runtime = @libdir + "/runtime"
@lib_path = @libdir + "/lib"
@@ -107,7 +109,7 @@ class Configure
@libversion = "2.0"
@version = "#{@libversion}.0dev"
@release_date = "yyyy-mm-dd"
- @config_version = 130
+ @config_version = 131
# TODO: add conditionals for platforms
if RbConfig::CONFIG["build_os"] =~ /darwin/
@@ -244,7 +246,9 @@ class Configure
end
@bindir = dir + "/bin"
- @includedir = dir + "/include"
+ @include18dir = dir + "/18/include"
+ @include19dir = dir + "/19/include"
+ @include20dir = dir + "/19/include"
@libdir = dir
@runtime = @libdir + "/runtime"
@lib_path = @libdir + "/lib"
@@ -263,7 +267,10 @@ class Configure
o.on "-I", "--includedir", "PATH", "Install Rubinius C-API include files in PATH" do |dir|
@install = true
- @includedir = expand dir
+ path = expand dir
+ @include18dir = path + "/18"
+ @include19dir = path + "/19"
+ @include20dir = path + "/20"
end
o.on "-L", "--libdir", "PATH", "Install Ruby library in PATH" do |dir|
@@ -939,7 +946,9 @@ module Rubinius
:runtime => "#{@runtime}",
:lib_path => "#{@lib_path}",
:ext_path => "#{@ext_path}",
- :includedir => "#{@includedir}",
+ :include18dir => "#{@include18dir}",
+ :include19dir => "#{@include19dir}",
+ :include20dir => "#{@include20dir}",
:mandir => "#{@mandir}",
:gemsdir => "#{@gemsdir}",
:sitedir => "#{@sitedir}",
@@ -976,7 +985,9 @@ end
#define RBX_RUNTIME "#{@runtime}"
#define RBX_LIB_PATH "#{@lib_path}"
#define RBX_EXT_PATH "#{@ext_path}"
-#define RBX_HDR_PATH "#{@includedir}"
+#define RBX_HDR18_PATH "#{@include18dir}"
+#define RBX_HDR19_PATH "#{@include19dir}"
+#define RBX_HDR20_PATH "#{@include20dir}"
#define RBX_SITE_PATH "#{@sitedir}"
#define RBX_VENDOR_PATH "#{@vendordir}"
#define RBX_VERSION "#{@version}"
@@ -1021,7 +1032,9 @@ end
#define RBX_RUNTIME "#{@runtime}"
#define RBX_LIB_PATH "#{@lib_path}"
#define RBX_EXT_PATH "#{@ext_path}"
-#define RBX_HDR_PATH "#{@includedir}"
+#define RBX_HDR18_PATH "#{@include18dir}"
+#define RBX_HDR19_PATH "#{@include19dir}"
+#define RBX_HDR20_PATH "#{@include20dir}"
#define RBX_SITE_PATH "#{@sitedir}"
#define RBX_VENDOR_PATH "#{@vendordir}"
#define RBX_VERSION "#{@version}"
View
2 lib/mkmf.rb
@@ -131,7 +131,7 @@ def map_dir(dir, map = nil)
end
# ---------------------- Changed for Rubinius --------------------------------
-$topdir = ENV['RBX_CAPI_DIR'] || Rubinius::HDR_PATH
+$topdir = ENV['RBX_CAPI_DIR'] || RbConfig::CONFIG["rubyhdrdir"]
$top_srcdir = $topdir
$hdrdir = $topdir
View
11 lib/rbconfig.rb
@@ -41,7 +41,16 @@ module RbConfig
CONFIG["TEENY"] = teeny
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
CONFIG["RUBY_SO_NAME"] = "rubinius-#{Rubinius::VERSION}"
- CONFIG["rubyhdrdir"] = "#{Rubinius::HDR_PATH}"
+
+ case
+ when Rubinius.ruby18?
+ CONFIG["rubyhdrdir"] = "#{Rubinius::HDR18_PATH}"
+ when Rubinius.ruby19?
+ CONFIG["rubyhdrdir"] = "#{Rubinius::HDR19_PATH}"
+ when Rubinius.ruby20?
+ CONFIG["rubyhdrdir"] = "#{Rubinius::HDR20_PATH}"
+ end
+
CONFIG["LIBS"] = ""
sitedir = Rubinius::SITE_PATH
View
16 rakelib/ext_helper.rb
@@ -115,10 +115,19 @@ def add_mri_capi
end
end
+def include18_dir
+ File.expand_path("../../vm/capi/18/include", __FILE__)
+end
+
+def include19_dir
+ File.expand_path("../../vm/capi/18/include", __FILE__)
+end
+
def add_rbx_capi
add_cflag "-ggdb3 -O2"
add_cxxflag "-ggdb3 -O2"
- add_include_dir File.expand_path("../../vm/capi/include", __FILE__)
+ add_include_dir include18_dir
+ add_include_dir include19_dir
end
# Setup some initial computed values
@@ -194,7 +203,8 @@ def init
#
def common_headers(*extra)
@common_headers ||= FileList[
- File.expand_path("../../vm/capi/include/*.h", __FILE__),
+ include18_dir + "/*.h",
+ include19_dir + "/*.h",
*extra
].existing
end
@@ -217,7 +227,7 @@ def dependency_file
def graph_dependencies(sources, directories=[])
directories = Array(directories)
- directories.concat [".", File.expand_path("../../vm/capi/include", __FILE__)]
+ directories.concat [".", include18_dir, include19_dir]
grapher = DependencyGrapher.new sources, directories
grapher.process
View
5 rakelib/extensions.rake
@@ -17,9 +17,11 @@ namespace :extensions do
desc "Clean all lib/ext files"
task :clean do
clean_extension("**")
+ rm_f FileList["lib/tooling/**/*.{o,#{$dlext}}"], :verbose => $verbose
# TODO: implement per extension cleaning. This hack is for
# openssl and dl, which use extconf.rb and create Makefile.
rm_f FileList["lib/ext/**/Makefile"], :verbose => $verbose
+ rm_f FileList["lib/tooling/**/Makefile"], :verbose => $verbose
rm_f FileList["lib/ext/dl/*.func"], :verbose => $verbose
end
end
@@ -43,11 +45,10 @@ def build_extconf(name, opts)
ENV["BUILD_RUBY"] = BUILD_CONFIG[:build_ruby]
unless File.directory? BUILD_CONFIG[:runtime]
- ENV["CFLAGS"] = "-Ivm/capi/include"
+ ENV["CFLAGS"] = "-I#{include18_dir} -I#{include19_dir}"
end
unless opts[:deps] and opts[:deps].all? { |n| File.exists? n }
- # unless File.exists?("Makefile") and File.exists?("extconf.h")
sh("#{rbx_build} extconf.rb #{redirect}", &fail_block)
end
View
10 spec/library/config/rbconfig_spec.rb
@@ -72,14 +72,17 @@ def it_has_entries(name, entries)
ruby_version_is "1.8"..."1.9" do
it_has_entries 'RbConfig::CONFIG', "ruby_version" => "1.8"
+ it_has_entries 'RbConfig::CONFIG', "rubyhdrdir" => Rubinius::HDR18_PATH
end
ruby_version_is "1.9"..."2.0" do
it_has_entries 'RbConfig::CONFIG', "ruby_version" => "1.9"
+ it_has_entries 'RbConfig::CONFIG', "rubyhdrdir" => Rubinius::HDR19_PATH
end
ruby_version_is "2.0" do
it_has_entries 'RbConfig::CONFIG', "ruby_version" => "2.0"
+ it_has_entries 'RbConfig::CONFIG', "rubyhdrdir" => Rubinius::HDR19_PATH
end
end
@@ -113,18 +116,17 @@ def it_has_entries(name, entries)
"archdir" => "#{sitelibdir}/#{arch}",
"sitearchdir" => "#{sitelibdir}/#{arch}",
"sitedir" => "#{sitedir}",
- "rubyhdrdir" => "#{Rubinius::HDR_PATH}"
}
it_has_entries 'RbConfig::MAKEFILE_CONFIG', entries
end
-describe "RbConfig#ruby" do
-
+describe "RbConfig#ruby" do
+
RbConfig.respond_to?(:ruby).should eql(true)
rb_path = RbConfig.ruby
- rb_path.should be_kind_of(String)
+ rb_path.should be_kind_of(String)
# needs to be an executable
File.executable?(rb_path).should eql(true)
View
1 vm/capi/18/include/config.h
View
20 vm/capi/18/include/defines.h
@@ -0,0 +1,20 @@
+/* Stub file provided for C extensions that expect it. All regular
+ * defines and prototypes are in ruby.h
+ */
+
+#define RUBY 1
+#define RUBINIUS 1
+
+#define HAVE_STDARG_PROTOTYPES 1
+
+/* These are defines directly related to MRI C-API symbols that the
+ * mkmf.rb discovery code (e.g. have_func("rb_str_set_len")) would
+ * attempt to find by linking against libruby. Rubinius does not
+ * have an appropriate lib to link against, so we are adding these
+ * explicit defines for now.
+ */
+#define HAVE_RB_STR_SET_LEN 1
+#define HAVE_RB_DEFINE_ALLOC_FUNC 1
+
+#define HAVE_RB_HASH_FOREACH 1
+#define HAVE_RB_HASH_ASET 1
View
1 vm/capi/18/include/dl.h
View
1 vm/capi/18/include/intern.h
View
1 vm/capi/18/include/missing.h
View
1 vm/capi/18/include/rbx_config.h
View
1 vm/capi/18/include/rbxti.hpp
View
1 vm/capi/18/include/re.h
View
0 vm/capi/include/ruby.h → vm/capi/18/include/ruby.h
File renamed without changes.
View
1 vm/capi/18/include/rubyio.h
View
1 vm/capi/18/include/rubysig.h
View
1 vm/capi/18/include/st.h
View
1 vm/capi/18/include/util.h
View
7 vm/capi/include/version.h → vm/capi/18/include/version.h
@@ -1,6 +1,13 @@
#ifndef RBX_CAPI_VERSION_H
#define RBX_CAPI_VERSION_H
+/* The origin. (copied from MRI 1.9.2p180) */
+#define RUBY_AUTHOR "Yukihiro Matsumoto"
+#define RUBY_BIRTH_YEAR 1993
+#define RUBY_BIRTH_MONTH 2
+#define RUBY_BIRTH_DAY 24
+/* end copy */
+
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
View
1 vm/capi/19/include/config.h
View
0 vm/capi/include/defines.h → vm/capi/19/include/defines.h
File renamed without changes.
View
1 vm/capi/19/include/dl.h
View
1 vm/capi/19/include/intern.h
View
1 vm/capi/19/include/missing.h
View
1 vm/capi/19/include/rbx_config.h
View
1 vm/capi/19/include/rbxti.hpp
View
1 vm/capi/19/include/re.h
View
1,773 vm/capi/19/include/ruby.h
1,773 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
0 vm/capi/include/ruby/encoding.h → vm/capi/19/include/ruby/encoding.h
File renamed without changes.
View
0 vm/capi/include/ruby/oniguruma.h → vm/capi/19/include/ruby/oniguruma.h
File renamed without changes.
View
1 vm/capi/19/include/rubyio.h
View
1 vm/capi/19/include/rubysig.h
View
1 vm/capi/19/include/st.h
View
1 vm/capi/19/include/util.h
View
10 vm/capi/19/include/version.h
@@ -0,0 +1,10 @@
+#ifndef RBX_CAPI_VERSION_H
+#define RBX_CAPI_VERSION_H
+
+/* The origin. (copied from MRI 1.9.2p180) */
+#define RUBY_AUTHOR "Yukihiro Matsumoto"
+#define RUBY_BIRTH_YEAR 1993
+#define RUBY_BIRTH_MONTH 2
+#define RUBY_BIRTH_DAY 24
+
+#endif
View
2 vm/capi/array.cpp
@@ -10,7 +10,7 @@
#include "exception_point.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include <stdarg.h>
View
2 vm/capi/bignum.cpp
@@ -4,7 +4,7 @@
#include "builtin/object.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include "missing/math.h"
View
2 vm/capi/capi.cpp
@@ -24,7 +24,7 @@
#include "arguments.hpp"
#include "dispatch.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include <string>
#include <vector>
#include <tr1/unordered_map>
View
2 vm/capi/class.cpp
@@ -5,7 +5,7 @@
#include "helpers.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/data.cpp
@@ -4,7 +4,7 @@
#include "builtin/data.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
6 vm/capi/encoding.cpp
@@ -1,12 +1,12 @@
// TODO: resolve after importing Oniguruma from MRI
#include <stddef.h>
-#include "capi/include/ruby/oniguruma.h"
+#include "capi/19/include/ruby/oniguruma.h"
#include "builtin/encoding.hpp"
#include "builtin/nativemethod.hpp"
-#include "capi/include/ruby.h"
-#include "capi/include/ruby/encoding.h"
+#include "capi/19/include/ruby.h"
+#include "capi/19/include/ruby/encoding.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/exception.cpp
@@ -1,7 +1,7 @@
#include "builtin/exception.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
View
2 vm/capi/float.cpp
@@ -1,5 +1,5 @@
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include "builtin/float.hpp"
View
2 vm/capi/gc.cpp
@@ -3,7 +3,7 @@
#include "objectmemory.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/globals.cpp
@@ -3,7 +3,7 @@
#include "builtin/regexp.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/handle.cpp
@@ -1,7 +1,7 @@
#include "builtin/nativemethod.hpp"
#include "capi/handle.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
namespace rubinius {
namespace capi {
View
2 vm/capi/hash.cpp
@@ -1,5 +1,5 @@
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
1 vm/capi/include/ruby/st.h
View
2 vm/capi/io.cpp
@@ -8,7 +8,7 @@
#include "primitives.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include "windows_compat.h"
View
2 vm/capi/kernel.cpp
@@ -5,7 +5,7 @@
#include "exception_point.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
View
2 vm/capi/marshal.cpp
@@ -1,5 +1,5 @@
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/module.cpp
@@ -6,7 +6,7 @@
#include "call_frame.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/numeric.cpp
@@ -4,7 +4,7 @@
#include "builtin/object.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include <gdtoa.h>
View
2 vm/capi/object.cpp
@@ -5,7 +5,7 @@
#include "builtin/symbol.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/proc.cpp
@@ -2,7 +2,7 @@
#include "builtin/proc.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/range.cpp
@@ -1,5 +1,5 @@
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/regexp.cpp
@@ -9,7 +9,7 @@
#include "primitives.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
15 vm/capi/string.cpp
@@ -6,8 +6,7 @@
#include "builtin/string.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
-#include "capi/include/ruby/encoding.h"
+#include "capi/18/include/ruby.h"
#include <string.h>
@@ -251,18 +250,6 @@ extern "C" {
return rb_funcall(self, rb_intern("to_sym"), 0);
}
- VALUE rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
- {
- VALUE str = rb_str_new(ptr, len);
- rb_enc_associate(str, enc);
- return str;
- }
-
- int rb_enc_str_coderange(VALUE string) {
- // TODO
- return ENC_CODERANGE_7BIT;
- }
-
VALUE rb_str_new(const char* string, long length) {
if(length < 0) rb_raise(rb_eArgError, "invalid string size");
NativeMethodEnvironment* env = NativeMethodEnvironment::get();
View
33 vm/capi/string19.cpp
@@ -0,0 +1,33 @@
+#include "builtin/bytearray.hpp"
+#include "builtin/fixnum.hpp"
+#include "builtin/integer.hpp"
+#include "builtin/nativemethod.hpp"
+#include "builtin/object.hpp"
+#include "builtin/string.hpp"
+
+#include "capi/19/include/ruby.h"
+#include "capi/19/include/ruby/encoding.h"
+
+#include <string.h>
+
+using namespace rubinius;
+using namespace rubinius::capi;
+
+namespace rubinius {
+ namespace capi {
+ }
+}
+
+extern "C" {
+ VALUE rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
+ {
+ VALUE str = rb_str_new(ptr, len);
+ rb_enc_associate(str, enc);
+ return str;
+ }
+
+ int rb_enc_str_coderange(VALUE string) {
+ // TODO
+ return ENC_CODERANGE_7BIT;
+ }
+}
View
2 vm/capi/struct.cpp
@@ -1,7 +1,7 @@
#include "builtin/array.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include <stdarg.h>
View
2 vm/capi/symbol.cpp
@@ -1,7 +1,7 @@
#include "builtin/symbol.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/thread.cpp
@@ -5,7 +5,7 @@
#endif
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include "builtin/thread.hpp"
#include "windows_compat.h"
View
2 vm/capi/time.cpp
@@ -4,7 +4,7 @@
#include "builtin/time.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
2 vm/capi/util.cpp
@@ -2,7 +2,7 @@
#include "windows_compat.h"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
View
4 vm/ontology.cpp
@@ -384,7 +384,9 @@ namespace rubinius {
G(rubinius)->set_const(state, "BIN_PATH", String::create(state, RBX_BIN_PATH));
G(rubinius)->set_const(state, "LIB_PATH", String::create(state, RBX_LIB_PATH));
G(rubinius)->set_const(state, "EXT_PATH", String::create(state, RBX_EXT_PATH));
- G(rubinius)->set_const(state, "HDR_PATH", String::create(state, RBX_HDR_PATH));
+ G(rubinius)->set_const(state, "HDR18_PATH", String::create(state, RBX_HDR18_PATH));
+ G(rubinius)->set_const(state, "HDR19_PATH", String::create(state, RBX_HDR19_PATH));
+ G(rubinius)->set_const(state, "HDR20_PATH", String::create(state, RBX_HDR20_PATH));
G(rubinius)->set_const(state, "GEMS_PATH", String::create(state, RBX_GEMS_PATH));
G(rubinius)->set_const(state, "SITE_PATH", String::create(state, RBX_SITE_PATH));
G(rubinius)->set_const(state, "VENDOR_PATH", String::create(state, RBX_VENDOR_PATH));
View
2 vm/test/capi/test_constants.hpp
@@ -5,7 +5,7 @@
#include "builtin/nativemethod.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include "capi_reset.h"
View
2 vm/test/capi/test_handles.hpp
@@ -5,7 +5,7 @@
#include "builtin/nativemethod.hpp"
#include "capi/capi.hpp"
-#include "capi/include/ruby.h"
+#include "capi/18/include/ruby.h"
#include "capi_reset.h"

0 comments on commit 33c8f28

Please sign in to comment.
Something went wrong with that request. Please try again.