mirror of https://github.com/tinygo-org/tinygo.git
wasmstm32webassemblymicrocontrollerarmavrspiwasiadafruitarduinocircuitplayground-expressgpioi2cllvmmicrobitnrf51nrf52nrf52840samd21tinygo
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.
42 lines
862 B
42 lines
862 B
package main
|
|
|
|
import "unsafe"
|
|
|
|
var _ unsafe.Pointer
|
|
|
|
//go:linkname C.CString runtime.cgo_CString
|
|
func C.CString(string) *C.char
|
|
|
|
//go:linkname C.GoString runtime.cgo_GoString
|
|
func C.GoString(*C.char) string
|
|
|
|
//go:linkname C.__GoStringN runtime.cgo_GoStringN
|
|
func C.__GoStringN(*C.char, uintptr) string
|
|
|
|
func C.GoStringN(cstr *C.char, length C.int) string {
|
|
return C.__GoStringN(cstr, uintptr(length))
|
|
}
|
|
|
|
//go:linkname C.__GoBytes runtime.cgo_GoBytes
|
|
func C.__GoBytes(unsafe.Pointer, uintptr) []byte
|
|
|
|
func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte {
|
|
return C.__GoBytes(ptr, uintptr(length))
|
|
}
|
|
|
|
type (
|
|
C.char uint8
|
|
C.schar int8
|
|
C.uchar uint8
|
|
C.short int16
|
|
C.ushort uint16
|
|
C.int int32
|
|
C.uint uint32
|
|
C.long int32
|
|
C.ulong uint32
|
|
C.longlong int64
|
|
C.ulonglong uint64
|
|
)
|
|
|
|
const C.foo = 3
|
|
const C.bar = C.foo
|
|
|