#131
How to make int8_t from c to int8 in golang?
Just finished running some golang tests after the autogeneration, I found one function where int8_t is getting turned into a byte instead of int8. How do you specify in the yml to make int8_t to int8, I read the docs but I couldn't understand how to do it. Or is this another custom header type of issue?
LIB_EXPORT int8_t plc_tag_get_int8(int32_t tag, int offset);
LIB_EXPORT int plc_tag_set_int8(int32_t, int offset, int8_t val);Here if I change byte to int8 on GetInt8 return, and SetInt8 val, then the tests pass.
// GetInt8 function as declared in include/libplctag.h:492
func GetInt8(tag int32, offset int32) byte {
ctag, ctagAllocMap := (C.int32_t)(tag), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
__ret := C.plc_tag_get_int8(ctag, coffset)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(ctagAllocMap)
__v := (byte)(__ret)
return __v
}
// SetInt8 function as declared in include/libplctag.h:493
func SetInt8(arg0 int32, offset int32, val byte) int32 {
carg0, carg0AllocMap := (C.int32_t)(arg0), cgoAllocsUnknown
coffset, coffsetAllocMap := (C.int)(offset), cgoAllocsUnknown
cval, cvalAllocMap := (C.int8_t)(val), cgoAllocsUnknown
__ret := C.plc_tag_set_int8(carg0, coffset, cval)
runtime.KeepAlive(cvalAllocMap)
runtime.KeepAlive(coffsetAllocMap)
runtime.KeepAlive(carg0AllocMap)
__v := (int32)(__ret)
return __v
}
Here's my yml if it helps https://github.com/libplctag/goplctag/blob/auto-bindings-2/goplctag.yml