summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar/function_definition.hpp
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-28 15:32:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 10:17:46 +0900
commitcb7f2d0dd5da40be7ae0bcaf89ceebe3c0d32b6d (patch)
treeabd8ea0fac0c76cb420dbf7d3d2ce96eb3b5400c /src/lib/eolian_cxx/grammar/function_definition.hpp
parent9d14b4cfe8e7c073952067cd2258b9e09fea4f93 (diff)
cxx: Add header guards for manual definitions
This will be used for things like efl_del efl_part was a lucky case where the entire class was to be implemented manually, thus the global header guard was sufficient.
Diffstat (limited to '')
-rw-r--r--src/lib/eolian_cxx/grammar/function_definition.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp b/src/lib/eolian_cxx/grammar/function_definition.hpp
index 1ffbed4bb3..46df876b33 100644
--- a/src/lib/eolian_cxx/grammar/function_definition.hpp
+++ b/src/lib/eolian_cxx/grammar/function_definition.hpp
@@ -54,6 +54,11 @@ struct function_definition_generator
54 .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx))) 54 .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx)))
55 return false; 55 return false;
56 56
57 if(!as_generator
58 ("#ifndef EOLIAN_CXX_" << string << "_IMPLEMENTATION\n")
59 .generate(sink, f.c_name, add_upper_case_context(ctx)))
60 return false;
61
57 std::string template_statement(f.template_statement()); 62 std::string template_statement(f.template_statement());
58 if (!template_statement.empty() && 63 if (!template_statement.empty() &&
59 !as_generator(template_statement << "\n") 64 !as_generator(template_statement << "\n")
@@ -161,6 +166,12 @@ struct function_definition_generator
161 if(!as_generator("}\n").generate(sink, attributes::unused, ctx)) 166 if(!as_generator("}\n").generate(sink, attributes::unused, ctx))
162 return false; 167 return false;
163 168
169 if(!as_generator
170 ("#else\n" << scope_tab << "EOLIAN_CXX_" << string << "_IMPLEMENTATION\n"
171 "#endif\n")
172 .generate(sink, f.c_name, add_upper_case_context(ctx)))
173 return false;
174
164 if(f.is_beta && 175 if(f.is_beta &&
165 !as_generator("#endif\n").generate(sink, attributes::unused, ctx)) 176 !as_generator("#endif\n").generate(sink, attributes::unused, ctx))
166 return false; 177 return false;