cgen: 4 byte bool flagg for compatibility with some C software
parent
09955b7ce8
commit
325e116b7a
|
@ -2913,7 +2913,7 @@ pub fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool)
|
||||||
if call_arg.typ != param.typ
|
if call_arg.typ != param.typ
|
||||||
&& (param.typ == ast.voidptr_type || final_param_sym.idx == ast.voidptr_type_idx)
|
&& (param.typ == ast.voidptr_type || final_param_sym.idx == ast.voidptr_type_idx)
|
||||||
&& !call_arg.typ.is_any_kind_of_pointer() && func.language == .v
|
&& !call_arg.typ.is_any_kind_of_pointer() && func.language == .v
|
||||||
&& !call_arg.expr.is_lvalue() && func.name != 'json.encode' {
|
&& !call_arg.expr.is_lvalue() && func.name != 'json.encode' && !c.pref.translated {
|
||||||
c.error('expression cannot be passed as `voidptr`', call_arg.expr.position())
|
c.error('expression cannot be passed as `voidptr`', call_arg.expr.position())
|
||||||
}
|
}
|
||||||
// Handle expected interface
|
// Handle expected interface
|
||||||
|
|
|
@ -542,8 +542,11 @@ typedef struct sync__Channel* chan;
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
#ifndef bool
|
#ifndef bool
|
||||||
//typedef int bool;
|
#ifdef CUSTOM_DEFINE_4bytebool
|
||||||
|
typedef int bool;
|
||||||
|
#else
|
||||||
typedef byte bool;
|
typedef byte bool;
|
||||||
|
#endif
|
||||||
#define true 1
|
#define true 1
|
||||||
#define false 0
|
#define false 0
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue