You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openim-sdk-cpp/c_cpp_wrapper/tools.go

32 lines
500 B

package main
/*
#include <stdio.h>
#include <stdlib.h>
*/
import "C"
import (
"encoding/json"
"strconv"
"unsafe"
)
func parseBool(b int) bool {
return !(b == 0)
}
func StructToJsonString(param interface{}) string {
dataType, _ := json.Marshal(param)
dataString := string(dataType)
return dataString
}
func FreeCString(strList ...*C.char) {
for _, str := range strList {
C.free(unsafe.Pointer(str))
}
}
func Int32ToString(intValue int32) string {
return strconv.Itoa(int(intValue))
}