Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
package main
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
foreign import libc "system:c"
|
||||
|
||||
@(default_calling_convention="c")
|
||||
foreign libc {
|
||||
@(link_name="strdup") cstrdup :: proc(_: cstring) -> cstring ---
|
||||
@(link_name="free") cfree :: proc(_: rawptr) ---
|
||||
}
|
||||
|
||||
main :: proc() {
|
||||
s1 : cstring = "hello"
|
||||
s2 := cstrdup(s1)
|
||||
fmt.printf("{}\n", s2)
|
||||
cfree(rawptr(s2))
|
||||
Loading…
Add table
Add a link
Reference in a new issue