Skip to content

Commit 4512a0f

Browse files
authored
Revert "refactor: remove clite.init() for non baremetal targets"
1 parent d3861ee commit 4512a0f

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

_demo/go/export/libexport.h.want

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ github_com_goplus_llgo__demo_go_export_init(void) GO_SYMBOL_RENAME("github.com/g
279279
void
280280
github_com_goplus_llgo_runtime_abi_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/abi.init")
281281

282+
void
283+
github_com_goplus_llgo_runtime_internal_clite_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite.init")
284+
282285
void
283286
github_com_goplus_llgo_runtime_internal_clite_bdwgc_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/bdwgc.init")
284287

runtime/internal/clite/c.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ import (
2020
"unsafe"
2121
)
2222

23+
const (
24+
// we want to execute init(), link / decl skips executing init()
25+
LLGoPackage = true
26+
)
27+
2328
type (
2429
Void = [0]byte
2530
Char = int8

runtime/internal/clite/stdio_baremetal.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ import (
2222
_ "unsafe"
2323
)
2424

25-
const (
26-
// we want to execute init(), link / decl skips executing init()
27-
LLGoPackage = true
28-
)
29-
3025
var Stdin FilePtr = Fopen(Str("/dev/stdin"), Str("r"))
3126
var Stdout FilePtr = Fopen(Str("/dev/stdout"), Str("w"))
3227
var Stderr FilePtr = Stdout

runtime/internal/clite/stdio_darwin.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ package c
2121

2222
import _ "unsafe"
2323

24-
const (
25-
LLGoPackage = "decl"
26-
)
27-
2824
//go:linkname Stdin __stdinp
2925
var Stdin FilePtr
3026

runtime/internal/clite/stdio_default.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ package c
2020

2121
import _ "unsafe"
2222

23-
const (
24-
LLGoPackage = "decl"
25-
)
26-
2723
//go:linkname Stdin stdin
2824
var Stdin FilePtr
2925

0 commit comments

Comments
 (0)