diff --git a/wrappers/csharp/genwrapper.py b/wrappers/csharp/genwrapper.py index e5aad72a7..0dab2d818 100644 --- a/wrappers/csharp/genwrapper.py +++ b/wrappers/csharp/genwrapper.py @@ -87,7 +87,7 @@ class CsharpTranslator(object): return 'void' elif _type.name == 'boolean': if dllImport: - res = 'int' # In C the bool_t is an integer + res = 'char' else: res = 'bool' elif _type.name == 'integer': @@ -223,7 +223,7 @@ class CsharpTranslator(object): else: methodDict['impl']['c_args'] += '(int)' + self.translate_argument_name(arg.name) elif self.translate_type(arg.type, False, False) == "bool": - methodDict['impl']['c_args'] += self.translate_argument_name(arg.name) + " ? 1 : 0" + methodDict['impl']['c_args'] += self.translate_argument_name(arg.name) + " ? '1' : '0'" elif self.get_class_array_type(self.translate_type(arg.type, False, False)) is not None: listtype = self.get_class_array_type(self.translate_type(arg.type, False, False)) if listtype == 'string': diff --git a/wrappers/csharp/wrapper_impl.mustache b/wrappers/csharp/wrapper_impl.mustache index f66c504fe..1c33e7aeb 100644 --- a/wrappers/csharp/wrapper_impl.mustache +++ b/wrappers/csharp/wrapper_impl.mustache @@ -484,7 +484,7 @@ namespace Linphone {{#exception}}if (exception_result != 0) throw new LinphoneException("{{property_name}} setter returned value " + exception_result);{{/exception}} {{/is_string}} {{#is_bool}} - {{#exception}}int exception_result = {{/exception}}{{setter_c_name}}({{setter_nativePtr}}value ? 1 : 0); + {{#exception}}int exception_result = {{/exception}}{{setter_c_name}}({{setter_nativePtr}}value ? '1' : '0'); {{#exception}}if (exception_result != 0) throw new LinphoneException("{{property_name}} setter returned value " + exception_result);{{/exception}} {{/is_bool}} {{#is_class}} @@ -525,7 +525,7 @@ namespace Linphone return Marshal.PtrToStringAnsi(stringPtr); {{/is_string}} {{#is_bool}} - {{return}}{{c_name}}({{nativePtr}}{{c_args}}) == 0 ? false : true; + {{return}}{{c_name}}({{nativePtr}}{{c_args}}) == '0' ? false : true; {{/is_bool}} {{#is_class}} IntPtr ptr = {{c_name}}({{nativePtr}}{{c_args}});