rice 2.1.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +2 -2
  3. data/Doxyfile +4 -16
  4. data/Makefile.am +2 -2
  5. data/Makefile.in +28 -17
  6. data/{README → README.md} +323 -328
  7. data/aclocal.m4 +104 -107
  8. data/ax_cxx_compile_stdcxx.m4 +951 -0
  9. data/configure +549 -238
  10. data/configure.ac +3 -3
  11. data/extconf.rb +11 -10
  12. data/rice/Array.hpp +16 -16
  13. data/rice/Array.ipp +11 -11
  14. data/rice/Class_defn.hpp +1 -0
  15. data/rice/Constructor.hpp +27 -371
  16. data/rice/Data_Object_defn.hpp +3 -3
  17. data/rice/Director.hpp +3 -3
  18. data/rice/Enum.ipp +1 -1
  19. data/rice/Exception.cpp +2 -7
  20. data/rice/Hash.hpp +8 -5
  21. data/rice/Hash.ipp +2 -2
  22. data/rice/Makefile.am +1 -4
  23. data/rice/Makefile.in +80 -35
  24. data/rice/Module_impl.ipp +1 -1
  25. data/rice/Object.cpp +1 -1
  26. data/rice/Object.ipp +15 -1
  27. data/rice/Object_defn.hpp +24 -1
  28. data/rice/String.cpp +2 -7
  29. data/rice/Struct.cpp +2 -2
  30. data/rice/Struct.hpp +1 -1
  31. data/rice/Struct.ipp +1 -1
  32. data/rice/config.hpp +2 -2
  33. data/rice/config.hpp.in +2 -2
  34. data/rice/detail/Arguments.hpp +1 -1
  35. data/rice/detail/Auto_Function_Wrapper.ipp +512 -1025
  36. data/rice/detail/Auto_Member_Function_Wrapper.ipp +272 -545
  37. data/rice/detail/Iterator.hpp +2 -2
  38. data/rice/detail/method_data.cpp +8 -2
  39. data/rice/detail/ruby.hpp +1 -4
  40. data/rice/detail/ruby_version_code.hpp +1 -1
  41. data/rice/detail/wrap_function.hpp +32 -307
  42. data/rice/protect.hpp +3 -57
  43. data/rice/to_from_ruby.ipp +128 -4
  44. data/ruby/Makefile.in +11 -8
  45. data/ruby/lib/Makefile.in +10 -7
  46. data/ruby/lib/version.rb +1 -1
  47. data/sample/Makefile.am +10 -4
  48. data/sample/Makefile.in +20 -11
  49. data/sample/callbacks/extconf.rb +3 -0
  50. data/sample/callbacks/sample_callbacks.cpp +38 -0
  51. data/sample/callbacks/test.rb +28 -0
  52. data/test/Makefile.am +1 -0
  53. data/test/Makefile.in +118 -49
  54. data/test/embed_ruby.cpp +21 -0
  55. data/test/embed_ruby.hpp +4 -0
  56. data/test/ext/Makefile.in +10 -7
  57. data/test/test_Address_Registration_Guard.cpp +2 -1
  58. data/test/test_Array.cpp +2 -1
  59. data/test/test_Builtin_Object.cpp +2 -1
  60. data/test/test_Class.cpp +7 -4
  61. data/test/test_Data_Object.cpp +2 -1
  62. data/test/test_Data_Type.cpp +2 -1
  63. data/test/test_Director.cpp +2 -1
  64. data/test/test_Enum.cpp +24 -3
  65. data/test/test_Exception.cpp +2 -1
  66. data/test/test_Hash.cpp +2 -1
  67. data/test/test_Identifier.cpp +2 -1
  68. data/test/test_Memory_Management.cpp +2 -1
  69. data/test/test_Module.cpp +2 -1
  70. data/test/test_Object.cpp +13 -1
  71. data/test/test_String.cpp +2 -1
  72. data/test/test_Struct.cpp +2 -1
  73. data/test/test_Symbol.cpp +2 -1
  74. data/test/test_To_From_Ruby.cpp +102 -1
  75. data/test/test_global_functions.cpp +2 -1
  76. data/test/test_rice.rb +4 -0
  77. data/test/unittest.cpp +35 -9
  78. metadata +72 -16
  79. data/check_stdcxx_11.ac +0 -142
  80. data/rice/detail/object_call.hpp +0 -69
  81. data/rice/detail/object_call.ipp +0 -131
  82. data/rice/detail/traits.hpp +0 -43
  83. data/rice/detail/wrap_function.ipp +0 -514
@@ -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.15 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-2014 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) \
@@ -131,7 +131,20 @@ am__v_at_0 = @
131
131
  am__v_at_1 =
132
132
  DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/rice
133
133
  depcomp = $(SHELL) $(top_srcdir)/depcomp
134
- am__depfiles_maybe = depfiles
134
+ am__maybe_remake_depfiles = depfiles
135
+ am__depfiles_remade = ./$(DEPDIR)/embed_ruby.Po \
136
+ ./$(DEPDIR)/test_Address_Registration_Guard.Po \
137
+ ./$(DEPDIR)/test_Array.Po ./$(DEPDIR)/test_Builtin_Object.Po \
138
+ ./$(DEPDIR)/test_Class.Po ./$(DEPDIR)/test_Constructor.Po \
139
+ ./$(DEPDIR)/test_Data_Object.Po ./$(DEPDIR)/test_Data_Type.Po \
140
+ ./$(DEPDIR)/test_Director.Po ./$(DEPDIR)/test_Enum.Po \
141
+ ./$(DEPDIR)/test_Exception.Po ./$(DEPDIR)/test_Hash.Po \
142
+ ./$(DEPDIR)/test_Identifier.Po ./$(DEPDIR)/test_Jump_Tag.Po \
143
+ ./$(DEPDIR)/test_Memory_Management.Po \
144
+ ./$(DEPDIR)/test_Module.Po ./$(DEPDIR)/test_Object.Po \
145
+ ./$(DEPDIR)/test_String.Po ./$(DEPDIR)/test_Struct.Po \
146
+ ./$(DEPDIR)/test_Symbol.Po ./$(DEPDIR)/test_To_From_Ruby.Po \
147
+ ./$(DEPDIR)/test_global_functions.Po ./$(DEPDIR)/unittest.Po
135
148
  am__mv = mv -f
136
149
  CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
137
150
  $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -168,7 +181,7 @@ am__recursive_targets = \
168
181
  $(RECURSIVE_CLEAN_TARGETS) \
169
182
  $(am__extra_recursive_targets)
170
183
  AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
171
- check recheck distdir
184
+ check recheck distdir distdir-am
172
185
  am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
173
186
  # Read a list of newline-separated strings from the standard input,
174
187
  # and print each of them once, without duplicates. Input order is
@@ -370,6 +383,7 @@ am__set_TESTS_bases = \
370
383
  bases='$(TEST_LOGS)'; \
371
384
  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
372
385
  bases=`echo $$bases`
386
+ AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
373
387
  RECHECK_LOGS = $(TEST_LOGS)
374
388
  TEST_SUITE_LOG = test-suite.log
375
389
  TEST_EXTENSIONS = @EXEEXT@ .test
@@ -462,7 +476,7 @@ ECHO_C = @ECHO_C@
462
476
  ECHO_N = @ECHO_N@
463
477
  ECHO_T = @ECHO_T@
464
478
  EXEEXT = @EXEEXT@
465
- HAVE_CXX11 = @HAVE_CXX11@
479
+ HAVE_CXX14 = @HAVE_CXX14@
466
480
  INSTALL = @INSTALL@
467
481
  INSTALL_DATA = @INSTALL_DATA@
468
482
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -559,6 +573,7 @@ top_builddir = @top_builddir@
559
573
  top_srcdir = @top_srcdir@
560
574
  SUBDIRS = ext
561
575
  unittest_SOURCES = \
576
+ embed_ruby.cpp \
562
577
  unittest.cpp \
563
578
  test_Address_Registration_Guard.cpp \
564
579
  test_Array.cpp \
@@ -614,8 +629,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
614
629
  *config.status*) \
615
630
  cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
616
631
  *) \
617
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
618
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
632
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
633
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
619
634
  esac;
620
635
 
621
636
  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -640,28 +655,35 @@ mostlyclean-compile:
640
655
  distclean-compile:
641
656
  -rm -f *.tab.c
642
657
 
643
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Address_Registration_Guard.Po@am__quote@
644
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Array.Po@am__quote@
645
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Builtin_Object.Po@am__quote@
646
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Class.Po@am__quote@
647
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Constructor.Po@am__quote@
648
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Data_Object.Po@am__quote@
649
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Data_Type.Po@am__quote@
650
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Director.Po@am__quote@
651
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Enum.Po@am__quote@
652
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Exception.Po@am__quote@
653
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Hash.Po@am__quote@
654
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Identifier.Po@am__quote@
655
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Jump_Tag.Po@am__quote@
656
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Memory_Management.Po@am__quote@
657
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Module.Po@am__quote@
658
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Object.Po@am__quote@
659
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_String.Po@am__quote@
660
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Struct.Po@am__quote@
661
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Symbol.Po@am__quote@
662
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_To_From_Ruby.Po@am__quote@
663
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_global_functions.Po@am__quote@
664
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unittest.Po@am__quote@
658
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embed_ruby.Po@am__quote@ # am--include-marker
659
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Address_Registration_Guard.Po@am__quote@ # am--include-marker
660
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Array.Po@am__quote@ # am--include-marker
661
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Builtin_Object.Po@am__quote@ # am--include-marker
662
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Class.Po@am__quote@ # am--include-marker
663
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Constructor.Po@am__quote@ # am--include-marker
664
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Data_Object.Po@am__quote@ # am--include-marker
665
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Data_Type.Po@am__quote@ # am--include-marker
666
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Director.Po@am__quote@ # am--include-marker
667
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Enum.Po@am__quote@ # am--include-marker
668
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Exception.Po@am__quote@ # am--include-marker
669
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Hash.Po@am__quote@ # am--include-marker
670
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Identifier.Po@am__quote@ # am--include-marker
671
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Jump_Tag.Po@am__quote@ # am--include-marker
672
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Memory_Management.Po@am__quote@ # am--include-marker
673
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Module.Po@am__quote@ # am--include-marker
674
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Object.Po@am__quote@ # am--include-marker
675
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_String.Po@am__quote@ # am--include-marker
676
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Struct.Po@am__quote@ # am--include-marker
677
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_Symbol.Po@am__quote@ # am--include-marker
678
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_To_From_Ruby.Po@am__quote@ # am--include-marker
679
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_global_functions.Po@am__quote@ # am--include-marker
680
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unittest.Po@am__quote@ # am--include-marker
681
+
682
+ $(am__depfiles_remade):
683
+ @$(MKDIR_P) $(@D)
684
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
685
+
686
+ am--depfiles: $(am__depfiles_remade)
665
687
 
666
688
  .cpp.o:
667
689
  @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -885,7 +907,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
885
907
  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
886
908
  fi; \
887
909
  echo "$${col}$$br$${std}"; \
888
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
910
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
889
911
  echo "$${col}$$br$${std}"; \
890
912
  create_testsuite_report --maybe-color; \
891
913
  echo "$$col$$br$$std"; \
@@ -898,7 +920,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
898
920
  fi; \
899
921
  $$success || exit 1
900
922
 
901
- check-TESTS:
923
+ check-TESTS:
902
924
  @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
903
925
  @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
904
926
  @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -941,7 +963,10 @@ unittest.log: unittest$(EXEEXT)
941
963
  @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
942
964
  @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
943
965
 
944
- distdir: $(DISTFILES)
966
+ distdir: $(BUILT_SOURCES)
967
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
968
+
969
+ distdir-am: $(DISTFILES)
945
970
  @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
946
971
  topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
947
972
  list='$(DISTFILES)'; \
@@ -1040,7 +1065,29 @@ clean: clean-recursive
1040
1065
  clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
1041
1066
 
1042
1067
  distclean: distclean-recursive
1043
- -rm -rf ./$(DEPDIR)
1068
+ -rm -f ./$(DEPDIR)/embed_ruby.Po
1069
+ -rm -f ./$(DEPDIR)/test_Address_Registration_Guard.Po
1070
+ -rm -f ./$(DEPDIR)/test_Array.Po
1071
+ -rm -f ./$(DEPDIR)/test_Builtin_Object.Po
1072
+ -rm -f ./$(DEPDIR)/test_Class.Po
1073
+ -rm -f ./$(DEPDIR)/test_Constructor.Po
1074
+ -rm -f ./$(DEPDIR)/test_Data_Object.Po
1075
+ -rm -f ./$(DEPDIR)/test_Data_Type.Po
1076
+ -rm -f ./$(DEPDIR)/test_Director.Po
1077
+ -rm -f ./$(DEPDIR)/test_Enum.Po
1078
+ -rm -f ./$(DEPDIR)/test_Exception.Po
1079
+ -rm -f ./$(DEPDIR)/test_Hash.Po
1080
+ -rm -f ./$(DEPDIR)/test_Identifier.Po
1081
+ -rm -f ./$(DEPDIR)/test_Jump_Tag.Po
1082
+ -rm -f ./$(DEPDIR)/test_Memory_Management.Po
1083
+ -rm -f ./$(DEPDIR)/test_Module.Po
1084
+ -rm -f ./$(DEPDIR)/test_Object.Po
1085
+ -rm -f ./$(DEPDIR)/test_String.Po
1086
+ -rm -f ./$(DEPDIR)/test_Struct.Po
1087
+ -rm -f ./$(DEPDIR)/test_Symbol.Po
1088
+ -rm -f ./$(DEPDIR)/test_To_From_Ruby.Po
1089
+ -rm -f ./$(DEPDIR)/test_global_functions.Po
1090
+ -rm -f ./$(DEPDIR)/unittest.Po
1044
1091
  -rm -f Makefile
1045
1092
  distclean-am: clean-am distclean-compile distclean-generic \
1046
1093
  distclean-tags
@@ -1086,7 +1133,29 @@ install-ps-am:
1086
1133
  installcheck-am:
1087
1134
 
1088
1135
  maintainer-clean: maintainer-clean-recursive
1089
- -rm -rf ./$(DEPDIR)
1136
+ -rm -f ./$(DEPDIR)/embed_ruby.Po
1137
+ -rm -f ./$(DEPDIR)/test_Address_Registration_Guard.Po
1138
+ -rm -f ./$(DEPDIR)/test_Array.Po
1139
+ -rm -f ./$(DEPDIR)/test_Builtin_Object.Po
1140
+ -rm -f ./$(DEPDIR)/test_Class.Po
1141
+ -rm -f ./$(DEPDIR)/test_Constructor.Po
1142
+ -rm -f ./$(DEPDIR)/test_Data_Object.Po
1143
+ -rm -f ./$(DEPDIR)/test_Data_Type.Po
1144
+ -rm -f ./$(DEPDIR)/test_Director.Po
1145
+ -rm -f ./$(DEPDIR)/test_Enum.Po
1146
+ -rm -f ./$(DEPDIR)/test_Exception.Po
1147
+ -rm -f ./$(DEPDIR)/test_Hash.Po
1148
+ -rm -f ./$(DEPDIR)/test_Identifier.Po
1149
+ -rm -f ./$(DEPDIR)/test_Jump_Tag.Po
1150
+ -rm -f ./$(DEPDIR)/test_Memory_Management.Po
1151
+ -rm -f ./$(DEPDIR)/test_Module.Po
1152
+ -rm -f ./$(DEPDIR)/test_Object.Po
1153
+ -rm -f ./$(DEPDIR)/test_String.Po
1154
+ -rm -f ./$(DEPDIR)/test_Struct.Po
1155
+ -rm -f ./$(DEPDIR)/test_Symbol.Po
1156
+ -rm -f ./$(DEPDIR)/test_To_From_Ruby.Po
1157
+ -rm -f ./$(DEPDIR)/test_global_functions.Po
1158
+ -rm -f ./$(DEPDIR)/unittest.Po
1090
1159
  -rm -f Makefile
1091
1160
  maintainer-clean-am: distclean-am maintainer-clean-generic
1092
1161
 
@@ -1106,19 +1175,19 @@ uninstall-am:
1106
1175
 
1107
1176
  .MAKE: $(am__recursive_targets) check-am install-am install-strip
1108
1177
 
1109
- .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
1110
- check-TESTS check-am clean clean-generic clean-noinstPROGRAMS \
1111
- cscopelist-am ctags ctags-am distclean distclean-compile \
1112
- distclean-generic distclean-tags distdir dvi dvi-am html \
1113
- html-am info info-am install install-am install-data \
1114
- install-data-am install-dvi install-dvi-am install-exec \
1115
- install-exec-am install-html install-html-am install-info \
1116
- install-info-am install-man install-pdf install-pdf-am \
1117
- install-ps install-ps-am install-strip installcheck \
1118
- installcheck-am installdirs installdirs-am maintainer-clean \
1119
- maintainer-clean-generic mostlyclean mostlyclean-compile \
1120
- mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \
1121
- uninstall uninstall-am
1178
+ .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
1179
+ am--depfiles check check-TESTS check-am clean clean-generic \
1180
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
1181
+ distclean-compile distclean-generic distclean-tags distdir dvi \
1182
+ dvi-am html html-am info info-am install install-am \
1183
+ install-data install-data-am install-dvi install-dvi-am \
1184
+ install-exec install-exec-am install-html install-html-am \
1185
+ install-info install-info-am install-man install-pdf \
1186
+ install-pdf-am install-ps install-ps-am install-strip \
1187
+ installcheck installcheck-am installdirs installdirs-am \
1188
+ maintainer-clean maintainer-clean-generic mostlyclean \
1189
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
1190
+ recheck tags tags-am uninstall uninstall-am
1122
1191
 
1123
1192
  .PRECIOUS: Makefile
1124
1193
 
@@ -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.15 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-2014 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@
@@ -282,8 +282,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
282
282
  *config.status*) \
283
283
  cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
284
284
  *) \
285
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
286
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
285
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
286
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
287
287
  esac;
288
288
 
289
289
  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -301,7 +301,10 @@ ctags CTAGS:
301
301
  cscope cscopelist:
302
302
 
303
303
 
304
- distdir: $(DISTFILES)
304
+ distdir: $(BUILT_SOURCES)
305
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
306
+
307
+ distdir-am: $(DISTFILES)
305
308
  @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
306
309
  topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
307
310
  list='$(DISTFILES)'; \
@@ -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)
@@ -1,4 +1,5 @@
1
1
  #include "unittest.hpp"
2
+ #include "embed_ruby.hpp"
2
3
  #include "rice/Builtin_Object.hpp"
3
4
  #include "rice/Class.hpp"
4
5
 
@@ -8,7 +9,7 @@ TESTSUITE(Builtin_Object);
8
9
 
9
10
  SETUP(Builtin_Object)
10
11
  {
11
- ruby_init();
12
+ embed_ruby();
12
13
  }
13
14
 
14
15
  TESTCASE(construct_with_object)
@@ -1,4 +1,5 @@
1
1
  #include "unittest.hpp"
2
+ #include "embed_ruby.hpp"
2
3
  #include "rice/Class.hpp"
3
4
  #include "rice/Constructor.hpp"
4
5
  #include "rice/protect.hpp"
@@ -15,7 +16,7 @@ TESTSUITE(Class);
15
16
 
16
17
  SETUP(Class)
17
18
  {
18
- ruby_init();
19
+ embed_ruby();
19
20
  }
20
21
 
21
22
  TESTCASE(construct)
@@ -303,8 +304,10 @@ public:
303
304
  {
304
305
  }
305
306
 
306
- int * begin() { return array_; }
307
- int * end() { return array_ + length_; }
307
+ // Custom names to make sure we call the function pointers rather than
308
+ // expectable default names.
309
+ int * beginFoo() { return array_; }
310
+ int * endBar() { return array_ + length_; }
308
311
 
309
312
  private:
310
313
  int * array_;
@@ -325,7 +328,7 @@ TESTCASE(define_iterator)
325
328
  {
326
329
  int array[] = { 1, 2, 3 };
327
330
  Class c(anonymous_class());
328
- c.define_iterator(&Container::begin, &Container::end);
331
+ c.define_iterator(&Container::beginFoo, &Container::endBar);
329
332
  Container * container = new Container(array, 3);
330
333
  Object wrapped_container = Data_Wrap_Struct(
331
334
  c, 0, Default_Free_Function<Container>::free, container);