Fix typemaps for bool
The existing typemaps didn't make much sense, simplify (there doesn't seem to be any point in using $1_basetype when dealing with "bool") them and treat "const bool&" as "bool", not as pointer, as this is much more convenient in C. This also allows another unit test to pass.
This commit is contained in:
parent
8eba14c6e0
commit
29563ec98e
2 changed files with 4 additions and 7 deletions
|
|
@ -91,7 +91,6 @@ FAILING_CPP_TESTS := \
|
|||
struct_initialization_cpp \
|
||||
template_basic \
|
||||
template_default \
|
||||
template_default_class_parms_typedef \
|
||||
template_enum \
|
||||
template_explicit \
|
||||
template_typedef_fnc \
|
||||
|
|
|
|||
10
Lib/c/c.swg
10
Lib/c/c.swg
|
|
@ -123,9 +123,8 @@ same_macro_all_primitive_types_but_void(cref_as_value,ctype);
|
|||
%typemap(ctype) enum SWIGTYPE "int"
|
||||
%typemap(ctype) enum SWIGTYPE &, enum SWIGTYPE * "int *"
|
||||
|
||||
%typemap(ctype, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$1_ltype"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool & "$1_ltype"
|
||||
%typemap(ctype, fragment="stdbool_inc") const bool & "const $1_ltype"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool, const bool, const bool & "bool"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool *, const bool *, bool & "bool *"
|
||||
|
||||
// Typemaps for assigning wrapper parameters to local variables
|
||||
same_action_all_primitive_types(in, "$1 = ($1_ltype) $input;", "$1 = &$input;")
|
||||
|
|
@ -280,9 +279,8 @@ same_macro_all_primitive_types_but_void(cref_as_ptr,cppouttype);
|
|||
%typemap(cppouttype) enum SWIGTYPE &, enum SWIGTYPE * "int *"
|
||||
%typemap(cppouttype) SWIGTYPE (CLASS::*) "$1_ltype"
|
||||
|
||||
%typemap(cppouttype, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$1_ltype"
|
||||
%typemap(cppouttype, fragment="stdbool_inc") bool & "$1_basetype*"
|
||||
%typemap(cppouttype, fragment="stdbool_inc") const bool & "$1_basetype const *"
|
||||
%typemap(cppouttype, fragment="stdbool_inc") bool, const bool, const bool & "bool"
|
||||
%typemap(cppouttype, fragment="stdbool_inc") bool *, const bool *, bool & "bool *"
|
||||
|
||||
#ifdef SWIG_CPPMODE
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue