summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/marshall_annotation.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_annotation.hh16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
index 6ddb990..43c8060 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
@@ -90,7 +90,7 @@ struct marshall_annotation_visitor_generate
90 {"string", true, [&] { 90 {"string", true, [&] {
91 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]"; 91 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
92 }}, 92 }},
93 {"string", false, [&] { 93 {"string", nullptr, [&] {
94 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]"; 94 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
95 }}, 95 }},
96 {"mstring", true, [&] { 96 {"mstring", true, [&] {
@@ -216,16 +216,17 @@ struct marshall_native_annotation_visitor_generate
216 {"string", true, [&] { 216 {"string", true, [&] {
217 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]"; 217 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
218 }}, 218 }},
219 {"string", false, [&] { return ""; }}, 219 {"string", false, [&] {
220 return ""; }},
220 {"stringshare", true, [&] { 221 {"stringshare", true, [&] {
221 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]"; 222 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
222 }}, 223 }},
223 {"stringshare", false, [&] { return ""; }}, 224 {"stringshare", false, [&] { return ""; }},
224 {"strbuf", true, [&] { 225 {"strbuf", true, [&] {
225 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]"; 226 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
226 }}, 227 }},
227 {"strbuf", false, [&] { 228 {"strbuf", false, [&] {
228 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]"; 229 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
229 }}, 230 }},
230 }; 231 };
231 232
@@ -234,11 +235,16 @@ struct marshall_native_annotation_visitor_generate
234 , [&] (match const& m) 235 , [&] (match const& m)
235 { 236 {
236 return (!m.name || *m.name == regular.base_type) 237 return (!m.name || *m.name == regular.base_type)
237 && (!m.has_own || *m.has_own == (bool)(regular.base_qualifier & qualifier_info::is_own)) 238 && (!m.has_own || *m.has_own == static_cast<bool>(regular.base_qualifier & qualifier_info::is_own))
238 ; 239 ;
239 } 240 }
240 , [&] (std::string const& string) 241 , [&] (std::string const& string)
241 { 242 {
243 if (is_return)
244 {
245 std::string comment = "// Passed through match table with type " + regular.base_type + " and string is size " + std::to_string(string.size()) + "\n";
246 std::copy(comment.begin(), comment.end(), sink);
247 }
242 std::copy(string.begin(), string.end(), sink); 248 std::copy(string.begin(), string.end(), sink);
243 return true; 249 return true;
244 })) 250 }))