fix: change clite's LLGoPackage to true to execute its init()

This commit is contained in:
Haolan
2025-09-10 14:14:22 +08:00
parent 0ed3a54244
commit 0bbdb6c204
4 changed files with 16 additions and 18 deletions

View File

@@ -21,7 +21,8 @@ import (
)
const (
LLGoPackage = "link"
// we want to execute init(), link / decl skips executing init()
LLGoPackage = true
)
type (

View File

@@ -18,9 +18,12 @@
package c
import _ "unsafe"
import (
_ "unsafe"
// initialized by z_print because LLGoPackage skips calling init()
var Stdin FilePtr
var Stdout FilePtr
var Stderr FilePtr
"github.com/goplus/lib/c"
)
var Stdin FilePtr = c.Fopen(c.Str("/dev/stdin"), c.Str("r"))
var Stdout FilePtr = c.Fopen(c.Str("/dev/stdout"), c.Str("w"))
var Stderr FilePtr = Stdout