Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _demo/go/export/libexport.h.want
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ github_com_goplus_llgo__demo_go_export_init(void) GO_SYMBOL_RENAME("github.com/g
void
github_com_goplus_llgo_runtime_abi_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/abi.init")

void
github_com_goplus_llgo_runtime_internal_clite_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite.init")

void
github_com_goplus_llgo_runtime_internal_clite_bdwgc_init(void) GO_SYMBOL_RENAME("github.com/goplus/llgo/runtime/internal/clite/bdwgc.init")

Expand Down
5 changes: 5 additions & 0 deletions runtime/internal/clite/c.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ import (
"unsafe"
)

const (
// we want to execute init(), link / decl skips executing init()
LLGoPackage = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider expanding this comment to clarify that LLGoPackage accepts different values:

  • true - execute init()
  • "decl" or "link" - skip init() execution

This helps future maintainers understand why the previous per-platform configuration used string values in some files.

)

type (
Void = [0]byte
Char = int8
Expand Down
5 changes: 0 additions & 5 deletions runtime/internal/clite/stdio_baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ import (
_ "unsafe"
)

const (
// we want to execute init(), link / decl skips executing init()
LLGoPackage = true
)

var Stdin FilePtr = Fopen(Str("/dev/stdin"), Str("r"))
var Stdout FilePtr = Fopen(Str("/dev/stdout"), Str("w"))
var Stderr FilePtr = Stdout
4 changes: 0 additions & 4 deletions runtime/internal/clite/stdio_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ package c

import _ "unsafe"

const (
LLGoPackage = "decl"
)

//go:linkname Stdin __stdinp
var Stdin FilePtr

Expand Down
4 changes: 0 additions & 4 deletions runtime/internal/clite/stdio_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ package c

import _ "unsafe"

const (
LLGoPackage = "decl"
)

//go:linkname Stdin stdin
var Stdin FilePtr

Expand Down
Loading