summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2014-11-25 16:18:08 -0200
committerVitor Sousa <vitorsousasilva@gmail.com>2015-01-05 15:52:27 -0200
commitd5ec6c41d9bbd9e028503fe98dc6679f8c754140 (patch)
tree7f25de4940876272593b084e3fc449e516f84dba /src/bin
parent890ce1f9cf902ccd0011a4041fd90d05f93f3c8a (diff)
eolian_cxx: Fix: Using binding type for @out parameter instead of native type
No longer reverting to the native type when the parameter has "@out" direction. Added "is_out" member variable to eolian_type class. With that, generators can keep track of the direction of the parameters. Also added helper functions "type_is_out" and "type_is_complex". Created "to_native" functions in eo_cxx_interop.hh to convert binding types from C++ arguments to the actual C function arguments. Added static assertions in these functions to enforce compatibility between the binding and the native type (Required by @out parameters). Reworked the overload of the "to_c" function for eo::base derivated objects. Now there is a overload that rely in the compatibility between the native type and the wrapper, enabling a wrapper to be used as an output parameter.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 3dcb5e3c6b..d56379393f 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -348,7 +348,9 @@ parameter_type(Eolian_Function_Parameter const& parameter,
348 assert(!type.empty()); 348 assert(!type.empty());
349 if (parameter_is_out(parameter)) 349 if (parameter_is_out(parameter))
350 { 350 {
351 type = { efl::eolian::type_to_native(type) }; 351 if (type.front().native == "char *")
352 type = { efl::eolian::type_to_native(type) };
353 type.front().is_out = true;
352 type.front().native += "*"; 354 type.front().native += "*";
353 } 355 }
354 if (parameter_is_const(parameter, func_type)) 356 if (parameter_is_const(parameter, func_type))