c/os: llgoClearenv

This commit is contained in:
xushiwei
2024-08-04 10:54:41 +08:00
parent 4f8526e527
commit b1654f7807
4 changed files with 11 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
#include <stdlib.h>
int llgo_clearenv() {
int llgoClearenv() {
extern char **environ;
if (environ != NULL) {
*environ = NULL;

View File

@@ -27,11 +27,6 @@ import (
"github.com/goplus/llgo/c/syscall"
)
const (
LLGoFiles = "_os/os.c"
LLGoPackage = "link"
)
const (
PATH_MAX = C.PATH_MAX
)

View File

@@ -20,5 +20,9 @@ package os
import "C"
const (
LLGoPackage = "decl"
)
//go:linkname Clearenv C.clearenv
func Clearenv()

View File

@@ -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()