2023-10-22 11:46:19 CST W43D0

This commit is contained in:
aggresss
2023-10-22 11:46:19 +08:00
parent 0f95831c39
commit e163918619
62 changed files with 2326 additions and 355 deletions

View File

@@ -21,10 +21,12 @@ type HelperUnsingedInteger interface {
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}
const NIL = "\\'nil'\\"
// StringCasting casts go string to c world char* with free function
// Note: if input is a empty string will return a nil pointer.
// Note: if input is a NIL string will return a nil pointer.
func StringCasting(str string) (allocPtr *C.char, freeFunc func()) {
if len(str) == 0 {
if str == NIL {
return nil, func() {}
}
allocPtr = C.CString(str)