rice 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/COPYING +2 -2
  3. data/Doxyfile +1 -1
  4. data/Makefile.in +15 -7
  5. data/README.md +115 -117
  6. data/aclocal.m4 +25 -28
  7. data/ax_cxx_compile_stdcxx.m4 +951 -0
  8. data/configure +486 -61
  9. data/configure.ac +3 -3
  10. data/extconf.rb +6 -2
  11. data/rice/Array.hpp +16 -16
  12. data/rice/Array.ipp +11 -11
  13. data/rice/Class_defn.hpp +1 -0
  14. data/rice/Constructor.hpp +27 -371
  15. data/rice/Director.hpp +3 -3
  16. data/rice/Exception.cpp +2 -7
  17. data/rice/Hash.hpp +8 -5
  18. data/rice/Makefile.am +0 -4
  19. data/rice/Makefile.in +6 -10
  20. data/rice/Object.cpp +1 -1
  21. data/rice/Object.ipp +15 -1
  22. data/rice/Object_defn.hpp +24 -1
  23. data/rice/String.cpp +2 -7
  24. data/rice/Struct.cpp +2 -2
  25. data/rice/Struct.hpp +1 -1
  26. data/rice/Struct.ipp +1 -1
  27. data/rice/config.hpp +2 -2
  28. data/rice/config.hpp.in +2 -2
  29. data/rice/detail/Arguments.hpp +1 -1
  30. data/rice/detail/Auto_Function_Wrapper.ipp +512 -1025
  31. data/rice/detail/Auto_Member_Function_Wrapper.ipp +272 -545
  32. data/rice/detail/ruby.hpp +0 -4
  33. data/rice/detail/ruby_version_code.hpp +1 -1
  34. data/rice/detail/wrap_function.hpp +32 -307
  35. data/rice/protect.hpp +3 -57
  36. data/rice/to_from_ruby.ipp +3 -3
  37. data/ruby/Makefile.in +4 -4
  38. data/ruby/lib/Makefile.in +4 -4
  39. data/ruby/lib/version.rb +1 -1
  40. data/sample/Makefile.am +10 -4
  41. data/sample/Makefile.in +14 -8
  42. data/sample/callbacks/extconf.rb +3 -0
  43. data/sample/callbacks/sample_callbacks.cpp +38 -0
  44. data/sample/callbacks/test.rb +28 -0
  45. data/test/Makefile.am +1 -0
  46. data/test/Makefile.in +15 -9
  47. data/test/embed_ruby.cpp +21 -0
  48. data/test/embed_ruby.hpp +4 -0
  49. data/test/ext/Makefile.in +4 -4
  50. data/test/test_Address_Registration_Guard.cpp +2 -1
  51. data/test/test_Array.cpp +2 -1
  52. data/test/test_Builtin_Object.cpp +2 -1
  53. data/test/test_Class.cpp +2 -1
  54. data/test/test_Data_Object.cpp +2 -1
  55. data/test/test_Data_Type.cpp +2 -1
  56. data/test/test_Director.cpp +2 -1
  57. data/test/test_Enum.cpp +2 -1
  58. data/test/test_Exception.cpp +2 -1
  59. data/test/test_Hash.cpp +2 -1
  60. data/test/test_Identifier.cpp +2 -1
  61. data/test/test_Memory_Management.cpp +2 -1
  62. data/test/test_Module.cpp +2 -1
  63. data/test/test_Object.cpp +13 -1
  64. data/test/test_String.cpp +2 -1
  65. data/test/test_Struct.cpp +2 -1
  66. data/test/test_Symbol.cpp +2 -1
  67. data/test/test_To_From_Ruby.cpp +2 -1
  68. data/test/test_global_functions.cpp +2 -1
  69. data/test/test_rice.rb +4 -0
  70. data/test/unittest.cpp +34 -8
  71. metadata +26 -11
  72. data/check_stdcxx_11.ac +0 -103
  73. data/rice/detail/object_call.hpp +0 -69
  74. data/rice/detail/object_call.ipp +0 -131
  75. data/rice/detail/traits.hpp +0 -43
  76. data/rice/detail/wrap_function.ipp +0 -514
@@ -101,7 +101,7 @@ template<>
101
101
  inline
102
102
  long from_ruby<long>(Rice::Object x)
103
103
  {
104
- return Rice::protect(Rice::detail::num2long, x);
104
+ return (long)Rice::protect(Rice::detail::num2long, x);
105
105
  }
106
106
 
107
107
  template<>
@@ -225,7 +225,7 @@ template<>
225
225
  inline
226
226
  unsigned long from_ruby<unsigned long>(Rice::Object x)
227
227
  {
228
- return Rice::protect(Rice::detail::num2ulong, x);
228
+ return (unsigned long)Rice::protect(Rice::detail::num2ulong, x);
229
229
  }
230
230
 
231
231
  template<>
@@ -407,7 +407,7 @@ template<>
407
407
  inline
408
408
  Rice::Object to_ruby<std::string>(std::string const & x)
409
409
  {
410
- return Rice::protect(rb_str_new, x.data(), x.size());
410
+ return Rice::protect(rb_str_new, x.data(), (long)x.size());
411
411
  }
412
412
 
413
413
  template<>
@@ -1,7 +1,7 @@
1
- # Makefile.in generated by automake 1.16.1 from Makefile.am.
1
+ # Makefile.in generated by automake 1.16.3 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
- # Copyright (C) 1994-2018 Free Software Foundation, Inc.
4
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
5
5
 
6
6
  # This Makefile.in is free software; the Free Software Foundation
7
7
  # gives unlimited permission to copy and/or distribute it,
@@ -89,7 +89,7 @@ build_triplet = @build@
89
89
  host_triplet = @host@
90
90
  subdir = ruby
91
91
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92
- am__aclocal_m4_deps = $(top_srcdir)/check_stdcxx_11.ac \
92
+ am__aclocal_m4_deps = $(top_srcdir)/ax_cxx_compile_stdcxx.m4 \
93
93
  $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
94
94
  $(top_srcdir)/configure.ac
95
95
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -223,7 +223,7 @@ ECHO_C = @ECHO_C@
223
223
  ECHO_N = @ECHO_N@
224
224
  ECHO_T = @ECHO_T@
225
225
  EXEEXT = @EXEEXT@
226
- HAVE_CXX11 = @HAVE_CXX11@
226
+ HAVE_CXX14 = @HAVE_CXX14@
227
227
  INSTALL = @INSTALL@
228
228
  INSTALL_DATA = @INSTALL_DATA@
229
229
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1,7 +1,7 @@
1
- # Makefile.in generated by automake 1.16.1 from Makefile.am.
1
+ # Makefile.in generated by automake 1.16.3 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
- # Copyright (C) 1994-2018 Free Software Foundation, Inc.
4
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
5
5
 
6
6
  # This Makefile.in is free software; the Free Software Foundation
7
7
  # gives unlimited permission to copy and/or distribute it,
@@ -90,7 +90,7 @@ build_triplet = @build@
90
90
  host_triplet = @host@
91
91
  subdir = ruby/lib
92
92
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
93
- am__aclocal_m4_deps = $(top_srcdir)/check_stdcxx_11.ac \
93
+ am__aclocal_m4_deps = $(top_srcdir)/ax_cxx_compile_stdcxx.m4 \
94
94
  $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
95
95
  $(top_srcdir)/configure.ac
96
96
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -193,7 +193,7 @@ ECHO_C = @ECHO_C@
193
193
  ECHO_N = @ECHO_N@
194
194
  ECHO_T = @ECHO_T@
195
195
  EXEEXT = @EXEEXT@
196
- HAVE_CXX11 = @HAVE_CXX11@
196
+ HAVE_CXX14 = @HAVE_CXX14@
197
197
  INSTALL = @INSTALL@
198
198
  INSTALL_DATA = @INSTALL_DATA@
199
199
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1,3 +1,3 @@
1
1
  module Rice
2
- VERSION = "2.2.0"
2
+ VERSION = "3.0.0"
3
3
  end
@@ -10,7 +10,10 @@ EXTRA_DIST = \
10
10
  map/test.rb \
11
11
  inheritance/extconf.rb \
12
12
  inheritance/animals.cpp \
13
- inheritance/test.rb
13
+ inheritance/test.rb \
14
+ callbacks/extconf.rb \
15
+ callbacks/sample_callbacks.cpp \
16
+ callbacks/test.rb
14
17
 
15
18
  enum/Makefile: enum/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
16
19
  @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C enum extconf.rb $(EXTCONF_OPTIONS)
@@ -21,7 +24,10 @@ map/Makefile: map/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
21
24
  inheritance/Makefile: inheritance/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
22
25
  @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C inheritance extconf.rb $(EXTCONF_OPTIONS)
23
26
 
24
- all: enum/Makefile map/Makefile inheritance/Makefile all_extensions
27
+ callbacks/Makefile: callbacks/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
28
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C callbacks extconf.rb $(EXTCONF_OPTIONS)
29
+
30
+ all: enum/Makefile map/Makefile inheritance/Makefile callbacks/Makefile all_extensions
25
31
 
26
32
  all_extensions: $(addsuffix /Makefile,$(RICE_SAMPLES))
27
33
  @for sample in $(RICE_SAMPLES); \
@@ -29,7 +35,7 @@ all_extensions: $(addsuffix /Makefile,$(RICE_SAMPLES))
29
35
  ${MAKE} -C $${sample} all; \
30
36
  done
31
37
 
32
- clean: enum/Makefile map/Makefile inheritance/Makefile clean_extensions
38
+ clean: enum/Makefile map/Makefile inheritance/Makefile callbacks/Makefile clean_extensions
33
39
 
34
40
  clean_extensions:
35
41
  @for sample in $(RICE_SAMPLES); \
@@ -37,7 +43,7 @@ clean_extensions:
37
43
  ${MAKE} -C $${sample} clean; \
38
44
  done
39
45
 
40
- distclean: enum/Makefile map/Makefile inheritance/Makefile distclean_extensions
46
+ distclean: enum/Makefile map/Makefile inheritance/Makefile callbacks/Makefile distclean_extensions
41
47
 
42
48
  distclean_extensions:
43
49
  @for sample in $(RICE_SAMPLES);
@@ -1,7 +1,7 @@
1
- # Makefile.in generated by automake 1.16.1 from Makefile.am.
1
+ # Makefile.in generated by automake 1.16.3 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
- # Copyright (C) 1994-2018 Free Software Foundation, Inc.
4
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
5
5
 
6
6
  # This Makefile.in is free software; the Free Software Foundation
7
7
  # gives unlimited permission to copy and/or distribute it,
@@ -89,7 +89,7 @@ build_triplet = @build@
89
89
  host_triplet = @host@
90
90
  subdir = sample
91
91
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92
- am__aclocal_m4_deps = $(top_srcdir)/check_stdcxx_11.ac \
92
+ am__aclocal_m4_deps = $(top_srcdir)/ax_cxx_compile_stdcxx.m4 \
93
93
  $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
94
94
  $(top_srcdir)/configure.ac
95
95
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -163,7 +163,7 @@ ECHO_C = @ECHO_C@
163
163
  ECHO_N = @ECHO_N@
164
164
  ECHO_T = @ECHO_T@
165
165
  EXEEXT = @EXEEXT@
166
- HAVE_CXX11 = @HAVE_CXX11@
166
+ HAVE_CXX14 = @HAVE_CXX14@
167
167
  INSTALL = @INSTALL@
168
168
  INSTALL_DATA = @INSTALL_DATA@
169
169
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -265,7 +265,10 @@ EXTRA_DIST = \
265
265
  map/test.rb \
266
266
  inheritance/extconf.rb \
267
267
  inheritance/animals.cpp \
268
- inheritance/test.rb
268
+ inheritance/test.rb \
269
+ callbacks/extconf.rb \
270
+ callbacks/sample_callbacks.cpp \
271
+ callbacks/test.rb
269
272
 
270
273
  all: all-am
271
274
 
@@ -460,7 +463,10 @@ map/Makefile: map/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
460
463
  inheritance/Makefile: inheritance/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
461
464
  @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C inheritance extconf.rb $(EXTCONF_OPTIONS)
462
465
 
463
- all: enum/Makefile map/Makefile inheritance/Makefile all_extensions
466
+ callbacks/Makefile: callbacks/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
467
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C callbacks extconf.rb $(EXTCONF_OPTIONS)
468
+
469
+ all: enum/Makefile map/Makefile inheritance/Makefile callbacks/Makefile all_extensions
464
470
 
465
471
  all_extensions: $(addsuffix /Makefile,$(RICE_SAMPLES))
466
472
  @for sample in $(RICE_SAMPLES); \
@@ -468,7 +474,7 @@ all_extensions: $(addsuffix /Makefile,$(RICE_SAMPLES))
468
474
  ${MAKE} -C $${sample} all; \
469
475
  done
470
476
 
471
- clean: enum/Makefile map/Makefile inheritance/Makefile clean_extensions
477
+ clean: enum/Makefile map/Makefile inheritance/Makefile callbacks/Makefile clean_extensions
472
478
 
473
479
  clean_extensions:
474
480
  @for sample in $(RICE_SAMPLES); \
@@ -476,7 +482,7 @@ clean_extensions:
476
482
  ${MAKE} -C $${sample} clean; \
477
483
  done
478
484
 
479
- distclean: enum/Makefile map/Makefile inheritance/Makefile distclean_extensions
485
+ distclean: enum/Makefile map/Makefile inheritance/Makefile callbacks/Makefile distclean_extensions
480
486
 
481
487
  distclean_extensions:
482
488
  @for sample in $(RICE_SAMPLES);
@@ -0,0 +1,3 @@
1
+ require 'mkmf-rice'
2
+ create_makefile('sample_callbacks')
3
+
@@ -0,0 +1,38 @@
1
+ #include "rice/Data_Type.hpp"
2
+ #include "rice/Constructor.hpp"
3
+ #include "rice/String.hpp"
4
+
5
+ using namespace Rice;
6
+
7
+ namespace
8
+ {
9
+
10
+ class CallbackHolder {
11
+ public:
12
+
13
+ void registerCallback(Rice::Object cb) {
14
+ callback = cb;
15
+ }
16
+
17
+ Rice::Object fireCallback(Rice::String param) {
18
+ return callback.call("call", param);
19
+ }
20
+
21
+ Rice::Object callback;
22
+ };
23
+
24
+ } // namespace
25
+
26
+ extern "C"
27
+ void Init_sample_callbacks()
28
+ {
29
+ RUBY_TRY
30
+ {
31
+ define_class<CallbackHolder>("CallbackHolder")
32
+ .define_constructor(Constructor<CallbackHolder>())
33
+ .define_method("register_callback", &CallbackHolder::registerCallback)
34
+ .define_method("fire_callback", &CallbackHolder::fireCallback);
35
+ }
36
+ RUBY_CATCH
37
+ }
38
+
@@ -0,0 +1,28 @@
1
+ require 'sample_callbacks'
2
+
3
+ def hello(message)
4
+ "Hello #{message}"
5
+ end
6
+
7
+ cb1 = CallbackHolder.new
8
+ cb2 = CallbackHolder.new
9
+ cb3 = CallbackHolder.new
10
+
11
+ cb1.register_callback(lambda do |param|
12
+ "Callback 1 got param #{param}"
13
+ end)
14
+
15
+ cb2.register_callback(lambda do |param|
16
+ "Callback 2 got param #{param}"
17
+ end)
18
+
19
+ cb3.register_callback method(:hello)
20
+
21
+ puts "Calling Callback 1"
22
+ puts cb1.fire_callback("Hello")
23
+
24
+ puts "Calling Callback 2"
25
+ puts cb2.fire_callback("World")
26
+
27
+ puts "Calling Callback 3"
28
+ puts cb3.fire_callback("Ruby")
@@ -30,6 +30,7 @@ run_multiple_extensions_same_class_test:
30
30
 
31
31
 
32
32
  unittest_SOURCES = \
33
+ embed_ruby.cpp \
33
34
  unittest.cpp \
34
35
  test_Address_Registration_Guard.cpp \
35
36
  test_Array.cpp \
@@ -1,7 +1,7 @@
1
- # Makefile.in generated by automake 1.16.1 from Makefile.am.
1
+ # Makefile.in generated by automake 1.16.3 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
- # Copyright (C) 1994-2018 Free Software Foundation, Inc.
4
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
5
5
 
6
6
  # This Makefile.in is free software; the Free Software Foundation
7
7
  # gives unlimited permission to copy and/or distribute it,
@@ -92,7 +92,7 @@ noinst_PROGRAMS = unittest$(EXEEXT)
92
92
  TESTS = unittest$(EXEEXT)
93
93
  subdir = test
94
94
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
95
- am__aclocal_m4_deps = $(top_srcdir)/check_stdcxx_11.ac \
95
+ am__aclocal_m4_deps = $(top_srcdir)/ax_cxx_compile_stdcxx.m4 \
96
96
  $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
97
97
  $(top_srcdir)/configure.ac
98
98
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -103,7 +103,7 @@ CONFIG_HEADER = $(top_builddir)/rice/config.hpp
103
103
  CONFIG_CLEAN_FILES =
104
104
  CONFIG_CLEAN_VPATH_FILES =
105
105
  PROGRAMS = $(noinst_PROGRAMS)
106
- am_unittest_OBJECTS = unittest.$(OBJEXT) \
106
+ am_unittest_OBJECTS = embed_ruby.$(OBJEXT) unittest.$(OBJEXT) \
107
107
  test_Address_Registration_Guard.$(OBJEXT) test_Array.$(OBJEXT) \
108
108
  test_Builtin_Object.$(OBJEXT) test_Class.$(OBJEXT) \
109
109
  test_Constructor.$(OBJEXT) test_Data_Object.$(OBJEXT) \
@@ -132,7 +132,8 @@ am__v_at_1 =
132
132
  DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/rice
133
133
  depcomp = $(SHELL) $(top_srcdir)/depcomp
134
134
  am__maybe_remake_depfiles = depfiles
135
- am__depfiles_remade = ./$(DEPDIR)/test_Address_Registration_Guard.Po \
135
+ am__depfiles_remade = ./$(DEPDIR)/embed_ruby.Po \
136
+ ./$(DEPDIR)/test_Address_Registration_Guard.Po \
136
137
  ./$(DEPDIR)/test_Array.Po ./$(DEPDIR)/test_Builtin_Object.Po \
137
138
  ./$(DEPDIR)/test_Class.Po ./$(DEPDIR)/test_Constructor.Po \
138
139
  ./$(DEPDIR)/test_Data_Object.Po ./$(DEPDIR)/test_Data_Type.Po \
@@ -382,6 +383,7 @@ am__set_TESTS_bases = \
382
383
  bases='$(TEST_LOGS)'; \
383
384
  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
384
385
  bases=`echo $$bases`
386
+ AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
385
387
  RECHECK_LOGS = $(TEST_LOGS)
386
388
  TEST_SUITE_LOG = test-suite.log
387
389
  TEST_EXTENSIONS = @EXEEXT@ .test
@@ -474,7 +476,7 @@ ECHO_C = @ECHO_C@
474
476
  ECHO_N = @ECHO_N@
475
477
  ECHO_T = @ECHO_T@
476
478
  EXEEXT = @EXEEXT@
477
- HAVE_CXX11 = @HAVE_CXX11@
479
+ HAVE_CXX14 = @HAVE_CXX14@
478
480
  INSTALL = @INSTALL@
479
481
  INSTALL_DATA = @INSTALL_DATA@
480
482
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -571,6 +573,7 @@ top_builddir = @top_builddir@
571
573
  top_srcdir = @top_srcdir@
572
574
  SUBDIRS = ext
573
575
  unittest_SOURCES = \
576
+ embed_ruby.cpp \
574
577
  unittest.cpp \
575
578
  test_Address_Registration_Guard.cpp \
576
579
  test_Array.cpp \
@@ -652,6 +655,7 @@ mostlyclean-compile:
652
655
  distclean-compile:
653
656
  -rm -f *.tab.c
654
657
 
658
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embed_ruby.Po@am__quote@ # am--include-marker
655
659
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Address_Registration_Guard.Po@am__quote@ # am--include-marker
656
660
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Array.Po@am__quote@ # am--include-marker
657
661
  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Builtin_Object.Po@am__quote@ # am--include-marker
@@ -903,7 +907,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
903
907
  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
904
908
  fi; \
905
909
  echo "$${col}$$br$${std}"; \
906
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
910
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
907
911
  echo "$${col}$$br$${std}"; \
908
912
  create_testsuite_report --maybe-color; \
909
913
  echo "$$col$$br$$std"; \
@@ -1061,7 +1065,8 @@ clean: clean-recursive
1061
1065
  clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
1062
1066
 
1063
1067
  distclean: distclean-recursive
1064
- -rm -f ./$(DEPDIR)/test_Address_Registration_Guard.Po
1068
+ -rm -f ./$(DEPDIR)/embed_ruby.Po
1069
+ -rm -f ./$(DEPDIR)/test_Address_Registration_Guard.Po
1065
1070
  -rm -f ./$(DEPDIR)/test_Array.Po
1066
1071
  -rm -f ./$(DEPDIR)/test_Builtin_Object.Po
1067
1072
  -rm -f ./$(DEPDIR)/test_Class.Po
@@ -1128,7 +1133,8 @@ install-ps-am:
1128
1133
  installcheck-am:
1129
1134
 
1130
1135
  maintainer-clean: maintainer-clean-recursive
1131
- -rm -f ./$(DEPDIR)/test_Address_Registration_Guard.Po
1136
+ -rm -f ./$(DEPDIR)/embed_ruby.Po
1137
+ -rm -f ./$(DEPDIR)/test_Address_Registration_Guard.Po
1132
1138
  -rm -f ./$(DEPDIR)/test_Array.Po
1133
1139
  -rm -f ./$(DEPDIR)/test_Builtin_Object.Po
1134
1140
  -rm -f ./$(DEPDIR)/test_Class.Po
@@ -0,0 +1,21 @@
1
+ #include <ruby.h>
2
+
3
+ void embed_ruby()
4
+ {
5
+ static bool initialized__ = false;
6
+
7
+ if (!initialized__)
8
+ {
9
+ int argc = 0;
10
+ char* argv = (char*)malloc(1);
11
+ argv[0] = 0;
12
+ char** pArgv = &argv;
13
+
14
+ ruby_sysinit(&argc, &pArgv);
15
+ RUBY_INIT_STACK;
16
+ ruby_init();
17
+ ruby_init_loadpath();
18
+
19
+ initialized__ = true;
20
+ }
21
+ }
@@ -0,0 +1,4 @@
1
+ #ifndef Rice_embed_ruby
2
+ #define Rice_embed_ruby
3
+ void embed_ruby();
4
+ #endif
@@ -1,7 +1,7 @@
1
- # Makefile.in generated by automake 1.16.1 from Makefile.am.
1
+ # Makefile.in generated by automake 1.16.3 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
- # Copyright (C) 1994-2018 Free Software Foundation, Inc.
4
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
5
5
 
6
6
  # This Makefile.in is free software; the Free Software Foundation
7
7
  # gives unlimited permission to copy and/or distribute it,
@@ -89,7 +89,7 @@ build_triplet = @build@
89
89
  host_triplet = @host@
90
90
  subdir = test/ext
91
91
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92
- am__aclocal_m4_deps = $(top_srcdir)/check_stdcxx_11.ac \
92
+ am__aclocal_m4_deps = $(top_srcdir)/ax_cxx_compile_stdcxx.m4 \
93
93
  $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
94
94
  $(top_srcdir)/configure.ac
95
95
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -163,7 +163,7 @@ ECHO_C = @ECHO_C@
163
163
  ECHO_N = @ECHO_N@
164
164
  ECHO_T = @ECHO_T@
165
165
  EXEEXT = @EXEEXT@
166
- HAVE_CXX11 = @HAVE_CXX11@
166
+ HAVE_CXX14 = @HAVE_CXX14@
167
167
  INSTALL = @INSTALL@
168
168
  INSTALL_DATA = @INSTALL_DATA@
169
169
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1,4 +1,5 @@
1
1
  #include "unittest.hpp"
2
+ #include "embed_ruby.hpp"
2
3
  #include "rice/Address_Registration_Guard.hpp"
3
4
 
4
5
  using namespace Rice;
@@ -7,7 +8,7 @@ TESTSUITE(Address_Registration_Guard);
7
8
 
8
9
  SETUP(Address_Registration_Guard)
9
10
  {
10
- ruby_init();
11
+ embed_ruby();
11
12
  }
12
13
 
13
14
  TESTCASE(register_address)
@@ -1,4 +1,5 @@
1
1
  #include "unittest.hpp"
2
+ #include "embed_ruby.hpp"
2
3
  #include "rice/Array.hpp"
3
4
  #include "rice/String.hpp"
4
5
  #include "rice/global_function.hpp"
@@ -9,7 +10,7 @@ TESTSUITE(Array);
9
10
 
10
11
  SETUP(Array)
11
12
  {
12
- ruby_init();
13
+ embed_ruby();
13
14
  }
14
15
 
15
16
  TESTCASE(default_construct)