diff --git a/c/os/_os/os.c b/c/os/_os/os.c index af3c5085..5dd2fac7 100644 --- a/c/os/_os/os.c +++ b/c/os/_os/os.c @@ -1,6 +1,6 @@ #include -int llgo_clearenv() { +int llgoClearenv() { extern char **environ; if (environ != NULL) { *environ = NULL; diff --git a/c/os/os.go b/c/os/os.go index 7950f996..bcd97fe6 100644 --- a/c/os/os.go +++ b/c/os/os.go @@ -27,11 +27,6 @@ import ( "github.com/goplus/llgo/c/syscall" ) -const ( - LLGoFiles = "_os/os.c" - LLGoPackage = "link" -) - const ( PATH_MAX = C.PATH_MAX ) diff --git a/c/os/os_linux.go b/c/os/os_linux.go index b58dc1e2..0ea364b6 100644 --- a/c/os/os_linux.go +++ b/c/os/os_linux.go @@ -20,5 +20,9 @@ package os import "C" +const ( + LLGoPackage = "decl" +) + //go:linkname Clearenv C.clearenv func Clearenv() diff --git a/c/os/os_other.go b/c/os/os_other.go index 138195fd..ae78cd41 100644 --- a/c/os/os_other.go +++ b/c/os/os_other.go @@ -20,5 +20,10 @@ package os import "C" -//go:linkname Clearenv C.llgo_clearenv +const ( + LLGoFiles = "_os/os.c" + LLGoPackage = "link" +) + +//go:linkname Clearenv C.llgoClearenv func Clearenv()