summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2015-06-24 15:23:01 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-24 15:23:01 +0100
commitdae35333fd905507ddae01a69add184ea1e3d10f (patch)
tree3c06a501248acbbb01234a77a376275c7f84a2ba /src
parenteff0e37947d939dc26a2a9997ca79d3d8b5effae (diff)
eolian_cxx: Use C++ wrappers instead of native types as parameters
Summary: Using C++ wrapper types in the signature of methods of the generated classes. Now, when the type is an Eo type defined in Eolian, eolian_cxx will detect it and use the equivalent C++ wrapper. Types defined in Eolian no longer need to be specified in the lookup table, so removed them from there. Disable wrapping of non-const char*. The current wrapper (unique_ptr) is not suited for some required operations like ownership acquisition from C code. Fix constructing properties that only have the "set" method. Fix translation of non-const parameters. Modified Makefiles to allow proper inclusion of evas_cxx headers required by some tests and examples. Move one auxiliary function to another reader to make it more accessible. @feature Reviewers: felipealmeida, q66, cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2752
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Ecore_Audio_Cxx.am5
-rw-r--r--src/Makefile_Ecore_Cxx.am5
-rw-r--r--src/Makefile_Edje_Cxx.am2
-rw-r--r--src/Makefile_Evas_Cxx.am1
-rw-r--r--src/bin/eolian_cxx/convert.cc2
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh13
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh36
-rw-r--r--src/bin/eolian_cxx/type_lookup_table.cc4
-rw-r--r--src/bindings/eo_cxx/eo_cxx_interop.hh4
-rw-r--r--src/examples/evas/Makefile.am1
-rw-r--r--src/lib/eolian_cxx/grammar/eo_header_generator.hh12
11 files changed, 57 insertions, 28 deletions
diff --git a/src/Makefile_Ecore_Audio_Cxx.am b/src/Makefile_Ecore_Audio_Cxx.am
index d31d3ec..e8833ba 100644
--- a/src/Makefile_Ecore_Audio_Cxx.am
+++ b/src/Makefile_Ecore_Audio_Cxx.am
@@ -35,12 +35,13 @@ tests_ecore_audio_cxx_cxx_compile_test_CPPFLAGS = \
35-I$(top_srcdir)/src/lib/efl \ 35-I$(top_srcdir)/src/lib/efl \
36-I$(builddir)/src/lib/efl \ 36-I$(builddir)/src/lib/efl \
37-I$(srcdir)/src/lib/efl \ 37-I$(srcdir)/src/lib/efl \
38-I$(top_builddir)/src/lib/evas/canvas/ \
38-DTESTS_WD=\"`pwd`\" \ 39-DTESTS_WD=\"`pwd`\" \
39-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_audio_cxx\" \ 40-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_audio_cxx\" \
40-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/ecore_audio_cxx\" \ 41-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/ecore_audio_cxx\" \
41-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_audio_cxx\" \ 42-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_audio_cxx\" \
42@CHECK_CFLAGS@ @ECORE_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_AUDIO_CFLAGS@ \ 43@CHECK_CFLAGS@ @ECORE_CFLAGS@ @EINA_CFLAGS@ @EVAS_CFLAGS@ @EO_CFLAGS@ @ECORE_AUDIO_CFLAGS@ \
43@ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EO_CXX_CFLAGS@ @ECORE_AUDIO_CXX_CFLAGS@ 44@ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ @EO_CXX_CFLAGS@ @ECORE_AUDIO_CXX_CFLAGS@
44 45
45tests_ecore_audio_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@ 46tests_ecore_audio_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@
46tests_ecore_audio_cxx_cxx_compile_test_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@ 47tests_ecore_audio_cxx_cxx_compile_test_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@
diff --git a/src/Makefile_Ecore_Cxx.am b/src/Makefile_Ecore_Cxx.am
index 35919e5..c0ec604 100644
--- a/src/Makefile_Ecore_Cxx.am
+++ b/src/Makefile_Ecore_Cxx.am
@@ -42,8 +42,8 @@ tests_ecore_cxx_ecore_cxx_suite_CPPFLAGS = \
42-I$(top_builddir)/src/lib/ecore \ 42-I$(top_builddir)/src/lib/ecore \
43-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_cxx\" \ 43-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_cxx\" \
44-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_cxx\" \ 44-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_cxx\" \
45@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EINA_CFLAGS@ \ 45@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ @EINA_CFLAGS@ \
46@ECORE_CFLAGS@ @EO_CFLAGS@ @EO_CXX_CFLAGS@ 46@ECORE_CFLAGS@ @EVAS_CFLAGS@ @EO_CFLAGS@ @EO_CXX_CFLAGS@
47 47
48tests_ecore_cxx_ecore_cxx_suite_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@ 48tests_ecore_cxx_ecore_cxx_suite_LDADD = @CHECK_LIBS@ @USE_ECORE_LIBS@
49tests_ecore_cxx_ecore_cxx_suite_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@ 49tests_ecore_cxx_ecore_cxx_suite_DEPENDENCIES = @USE_ECORE_INTERNAL_LIBS@
@@ -52,6 +52,7 @@ tests_ecore_cxx_cxx_compile_test_SOURCES = tests/ecore_cxx/cxx_compile_test.cc
52tests_ecore_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 52tests_ecore_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
53-I$(top_builddir)/src/lib/ecore \ 53-I$(top_builddir)/src/lib/ecore \
54-I$(top_builddir)/src/lib/efl/interfaces/ \ 54-I$(top_builddir)/src/lib/efl/interfaces/ \
55-I$(top_builddir)/src/lib/evas/canvas/ \
55-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_cxx\" \ 56-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/ecore_cxx\" \
56-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_cxx\" \ 57-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/ecore_cxx\" \
57@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EINA_CFLAGS@ \ 58@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EINA_CFLAGS@ \
diff --git a/src/Makefile_Edje_Cxx.am b/src/Makefile_Edje_Cxx.am
index c7f7a77..93ae9ab 100644
--- a/src/Makefile_Edje_Cxx.am
+++ b/src/Makefile_Edje_Cxx.am
@@ -34,7 +34,7 @@ tests_edje_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
34-I$(top_builddir)/src/lib/efl/interfaces/ \ 34-I$(top_builddir)/src/lib/efl/interfaces/ \
35-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/edje_cxx\" \ 35-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/edje_cxx\" \
36-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/edje_cxx\" \ 36-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/edje_cxx\" \
37@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EDJE_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \ 37@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ @EDJE_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \
38@ECORE_CFLAGS@ @EINA_CFLAGS@ @EVAS_CFLAGS@ @EDJE_CFLAGS@ @EO_CFLAGS@ 38@ECORE_CFLAGS@ @EINA_CFLAGS@ @EVAS_CFLAGS@ @EDJE_CFLAGS@ @EO_CFLAGS@
39tests_edje_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_EDJE_LIBS@ 39tests_edje_cxx_cxx_compile_test_LDADD = @CHECK_LIBS@ @USE_EDJE_LIBS@
40tests_edje_cxx_cxx_compile_test_DEPENDENCIES = @USE_EDJE_INTERNAL_LIBS@ 40tests_edje_cxx_cxx_compile_test_DEPENDENCIES = @USE_EDJE_INTERNAL_LIBS@
diff --git a/src/Makefile_Evas_Cxx.am b/src/Makefile_Evas_Cxx.am
index 8f7a4d2..40ec40f 100644
--- a/src/Makefile_Evas_Cxx.am
+++ b/src/Makefile_Evas_Cxx.am
@@ -35,6 +35,7 @@ TESTS += tests/evas_cxx/cxx_compile_test
35tests_evas_cxx_cxx_compile_test_SOURCES = tests/evas_cxx/cxx_compile_test.cc 35tests_evas_cxx_cxx_compile_test_SOURCES = tests/evas_cxx/cxx_compile_test.cc
36tests_evas_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 36tests_evas_cxx_cxx_compile_test_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
37 -I$(top_builddir)/src/lib/efl/interfaces/ \ 37 -I$(top_builddir)/src/lib/efl/interfaces/ \
38 -I$(top_builddir)/src/lib/evas/canvas/ \
38 -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evas_cxx\" \ 39 -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/evas_cxx\" \
39 -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evas_cxx\" \ 40 -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/evas_cxx\" \
40 @CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \ 41 @CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \
diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index 051c6e3..1b42e66 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -302,7 +302,7 @@ convert_eolian_functions(efl::eolian::eo_class& cls, Eolian_Class const& klass)
302 Eolian_Function const& func = *(::eolian_constructor_function_get(&ctor)); 302 Eolian_Function const& func = *(::eolian_constructor_function_get(&ctor));
303 303
304 efl::eolian::eo_function f; 304 efl::eolian::eo_function f;
305 if (::eolian_function_type_get(&func) != EOLIAN_PROPERTY) 305 if (function_op_type(func) == EOLIAN_METHOD)
306 f = _convert_function(klass, func); 306 f = _convert_function(klass, func);
307 else 307 else
308 f = _convert_property_set_to_function(klass, func); 308 f = _convert_property_set_to_function(klass, func);
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 65f218d..9ea4f4c 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -97,19 +97,6 @@ class_eo_name(Eolian_Class const& klass)
97 (find_replace(class_full_name(klass) + "_" + suffix, ".", "_")); 97 (find_replace(class_full_name(klass) + "_" + suffix, ".", "_"));
98} 98}
99 99
100inline std::string
101class_format_cxx(std::string const& fullname)
102{
103 std::string s = fullname;
104 auto found = s.find(".");
105 while (found != std::string::npos)
106 {
107 s.replace(found, 1, "::");
108 found = s.find(".");
109 }
110 return s;
111}
112
113inline efl::eolian::eo_class::eo_class_type 100inline efl::eolian::eo_class::eo_class_type
114class_type(Eolian_Class const& klass) 101class_type(Eolian_Class const& klass)
115{ 102{
diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh
index f7be16e..38b683d 100644
--- a/src/bin/eolian_cxx/type_lookup.hh
+++ b/src/bin/eolian_cxx/type_lookup.hh
@@ -7,6 +7,7 @@
7#include <vector> 7#include <vector>
8#include <cctype> 8#include <cctype>
9#include <iterator> 9#include <iterator>
10#include <stdexcept>
10#include <cassert> 11#include <cassert>
11#include <cstddef> 12#include <cstddef>
12 13
@@ -23,6 +24,19 @@ namespace eolian_cxx {
23typedef std::vector<efl::eolian::eolian_type> lookup_table_type; 24typedef std::vector<efl::eolian::eolian_type> lookup_table_type;
24extern const lookup_table_type type_lookup_table; 25extern const lookup_table_type type_lookup_table;
25 26
27inline std::string
28class_format_cxx(std::string const& fullname)
29{
30 std::string s = fullname;
31 auto found = s.find(".");
32 while (found != std::string::npos)
33 {
34 s.replace(found, 1, "::");
35 found = s.find(".");
36 }
37 return s;
38}
39
26inline bool 40inline bool
27type_is_complex(Eolian_Type const& type) 41type_is_complex(Eolian_Type const& type)
28{ 42{
@@ -33,6 +47,28 @@ inline efl::eolian::eolian_type
33type_from_eolian(Eolian_Type const& type) 47type_from_eolian(Eolian_Type const& type)
34{ 48{
35 efl::eolian::eolian_type x; 49 efl::eolian::eolian_type x;
50
51 Eolian_Type_Type tpt = ::eolian_type_type_get(&type);
52 if (tpt == EOLIAN_TYPE_POINTER || tpt == EOLIAN_TYPE_ALIAS || tpt == EOLIAN_TYPE_REGULAR)
53 {
54 Eolian_Type const* base_type = ::eolian_type_base_type_get(&type);
55 if (base_type && ::eolian_type_type_get(base_type) == EOLIAN_TYPE_CLASS)
56 {
57 Eolian_Class const* klass = ::eolian_type_class_get(base_type);
58 if (klass)
59 {
60 x.category = efl::eolian::eolian_type::simple_;
61 x.is_class = true;
62 x.binding_requires_optional = false;
63 x.binding = "::" + class_format_cxx(safe_lower(safe_str(::eolian_class_full_name_get(klass))));
64
65 Eina_Stringshare* klass_file = ::eolian_class_file_get(klass);
66 if (klass_file)
67 x.includes = {safe_str(klass_file) + ".hh"};
68 }
69 }
70 }
71
36 x.native = normalize_spaces(safe_str(::eolian_type_c_type_get(&type))); 72 x.native = normalize_spaces(safe_str(::eolian_type_c_type_get(&type)));
37 x.is_own = ::eolian_type_is_own(&type); 73 x.is_own = ::eolian_type_is_own(&type);
38 x.is_const = ::eolian_type_is_const(&type); 74 x.is_const = ::eolian_type_is_const(&type);
diff --git a/src/bin/eolian_cxx/type_lookup_table.cc b/src/bin/eolian_cxx/type_lookup_table.cc
index dd00551..de65299 100644
--- a/src/bin/eolian_cxx/type_lookup_table.cc
+++ b/src/bin/eolian_cxx/type_lookup_table.cc
@@ -23,12 +23,10 @@ type_lookup_table
23 {"Eina_List *", eolian_type::complex_, false, true, true, true, "::efl::eina::list", {"eina-cxx/eina_list.hh"}}, 23 {"Eina_List *", eolian_type::complex_, false, true, true, true, "::efl::eina::list", {"eina-cxx/eina_list.hh"}},
24 {"const Eina_List *", eolian_type::complex_, true, false, true, true, "::efl::eina::crange_list", {"eina-cxx/eina_list.hh"}}, 24 {"const Eina_List *", eolian_type::complex_, true, false, true, true, "::efl::eina::crange_list", {"eina-cxx/eina_list.hh"}},
25 {"Eio_Filter_Direct_Cb", eolian_type::callback_, {"Eio.h"}}, 25 {"Eio_Filter_Direct_Cb", eolian_type::callback_, {"Eio.h"}},
26 {"Emodel *", eolian_type::simple_, false, false, true, false, "::emodel", {"Emodel.hh"}},
27 {"Eo *", eolian_type::simple_, false, true, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}}, 26 {"Eo *", eolian_type::simple_, false, true, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}},
28 {"Eo *", eolian_type::simple_, false, false, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}}, 27 {"Eo *", eolian_type::simple_, false, false, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}},
29 //{"Evas_Object_Box_Layout", eolian_type::callback_, {"Evas.h"}}, 28 //{"Evas_Object_Box_Layout", eolian_type::callback_, {"Evas.h"}},
30 {"Evas_Object *", eolian_type::simple_, false, false, true, false, "::evas::object", {"canvas/evas_object.eo.hh"}}, 29 //{"char *", eolian_type::simple_, false, true, true, false, "std::unique_ptr<char*>", {"memory"}},
31 {"char *", eolian_type::simple_, false, true, true, false, "std::unique_ptr<char*>", {"memory"}},
32 {"const Eina_Inlist *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}}, 30 {"const Eina_Inlist *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}},
33 {"const Eina_List *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_list", {"eina-cxx/eina_ptrlist.hh"}}, 31 {"const Eina_List *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_list", {"eina-cxx/eina_ptrlist.hh"}},
34 {"const char *", eolian_type::simple_, false, false, true, true, "::efl::eina::string_view", {"string"}}, 32 {"const char *", eolian_type::simple_, false, false, true, true, "::efl::eina::string_view", {"string"}},
diff --git a/src/bindings/eo_cxx/eo_cxx_interop.hh b/src/bindings/eo_cxx/eo_cxx_interop.hh
index ef3e9c7..e0fd2ed 100644
--- a/src/bindings/eo_cxx/eo_cxx_interop.hh
+++ b/src/bindings/eo_cxx/eo_cxx_interop.hh
@@ -100,14 +100,14 @@ Eo** to_c(T* v, typename std::enable_if<std::is_convertible<T*, ::efl::eo::concr
100} 100}
101 101
102template <typename R, typename T> 102template <typename R, typename T>
103R to_native(T const& v) 103R to_native(T& v)
104{ 104{
105 static_assert(sizeof(T) == sizeof(R), ""); 105 static_assert(sizeof(T) == sizeof(R), "");
106 return v.native_handle(); 106 return v.native_handle();
107} 107}
108 108
109template <typename R, typename T> 109template <typename R, typename T>
110R to_native(eina::optional<T> const& v) 110R to_native(eina::optional<T>& v)
111{ 111{
112 static_assert(sizeof(T) == sizeof(R), ""); 112 static_assert(sizeof(T) == sizeof(R), "");
113 if (!v) 113 if (!v)
diff --git a/src/examples/evas/Makefile.am b/src/examples/evas/Makefile.am
index ed9b8cb..5c39cbd 100644
--- a/src/examples/evas/Makefile.am
+++ b/src/examples/evas/Makefile.am
@@ -314,6 +314,7 @@ EXTRA_PROGRAMS += evas_cxx_rectangle
314evas_cxx_rectangle_SOURCES = evas_cxx_rectangle.cc 314evas_cxx_rectangle_SOURCES = evas_cxx_rectangle.cc
315evas_cxx_rectangle_LDADD = $(ECORE_EVAS_COMMON_LDADD) 315evas_cxx_rectangle_LDADD = $(ECORE_EVAS_COMMON_LDADD)
316evas_cxx_rectangle_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS) @EINA_CXX_CFLAGS@ @EO_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ \ 316evas_cxx_rectangle_CPPFLAGS = $(ECORE_EVAS_COMMON_CPPFLAGS) @EINA_CXX_CFLAGS@ @EO_CXX_CFLAGS@ @EVAS_CXX_CFLAGS@ \
317-I$(top_builddir)/src/lib/evas/canvas/ \
317$(AM_CPPFLAGS) @EVAS_CFLAGS@ 318$(AM_CPPFLAGS) @EVAS_CFLAGS@
318 319
319endif 320endif
diff --git a/src/lib/eolian_cxx/grammar/eo_header_generator.hh b/src/lib/eolian_cxx/grammar/eo_header_generator.hh
index 9ec4a3b..0b0fc55 100644
--- a/src/lib/eolian_cxx/grammar/eo_header_generator.hh
+++ b/src/lib/eolian_cxx/grammar/eo_header_generator.hh
@@ -41,8 +41,10 @@ namespace efl { namespace eolian { namespace grammar {
41struct include_dependencies 41struct include_dependencies
42{ 42{
43 eo_class const& _cls; 43 eo_class const& _cls;
44 include_dependencies(eo_class const& cls) 44 eo_generator_options const& _opts;
45 include_dependencies(eo_class const& cls, eo_generator_options const& opts)
45 : _cls(cls) 46 : _cls(cls)
47 , _opts(opts)
46 {} 48 {}
47}; 49};
48 50
@@ -58,7 +60,8 @@ operator<<(std::ostream& out, include_dependencies const& x)
58 it_p != last_p; ++it_p) 60 it_p != last_p; ++it_p)
59 for (eolian_type const& subtype : (*it_p).type.parts) 61 for (eolian_type const& subtype : (*it_p).type.parts)
60 for (std::string header : subtype.includes) 62 for (std::string header : subtype.includes)
61 headers.insert(header); 63 if (header != x._opts.header_decl_file_name)
64 headers.insert(header);
62 65
63 for (auto it = cls.functions.begin(), last = cls.functions.end(); 66 for (auto it = cls.functions.begin(), last = cls.functions.end();
64 it != last; ++it) 67 it != last; ++it)
@@ -66,7 +69,8 @@ operator<<(std::ostream& out, include_dependencies const& x)
66 it_p != last_p; ++it_p) 69 it_p != last_p; ++it_p)
67 for (eolian_type const& subtype : (*it_p).type.parts) 70 for (eolian_type const& subtype : (*it_p).type.parts)
68 for (std::string header : subtype.includes) 71 for (std::string header : subtype.includes)
69 headers.insert(header); 72 if (header != x._opts.header_decl_file_name)
73 headers.insert(header);
70 74
71 for (std::string header : headers) 75 for (std::string header : headers)
72 out << "#include <" << header << ">" << endl; 76 out << "#include <" << header << ">" << endl;
@@ -111,7 +115,7 @@ include_headers(std::ostream& out,
111 { 115 {
112 out << "#include \"" << cxx_header << "\"" << endl; 116 out << "#include \"" << cxx_header << "\"" << endl;
113 } 117 }
114 out << include_dependencies(cls) << endl; 118 out << include_dependencies(cls, opts) << endl;
115} 119}
116 120
117inline void 121inline void