runtime: compatible difference of stdio symbols between linux and others
This commit is contained in:
@@ -19,10 +19,6 @@ package c
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
||||
const (
|
||||
LLGoPackage = "decl"
|
||||
)
|
||||
|
||||
type (
|
||||
Char = int8
|
||||
Int = C.int
|
||||
@@ -30,13 +26,13 @@ type (
|
||||
FilePtr = unsafe.Pointer
|
||||
)
|
||||
|
||||
//go:linkname Stdin __stdinp
|
||||
//go:linkname Stdin llgo_stdin
|
||||
var Stdin FilePtr
|
||||
|
||||
//go:linkname Stdout __stdoutp
|
||||
//go:linkname Stdout llgo_stdout
|
||||
var Stdout FilePtr
|
||||
|
||||
//go:linkname Stderr __stderrp
|
||||
//go:linkname Stderr llgo_stderr
|
||||
var Stderr FilePtr
|
||||
|
||||
//go:linkname Str llgo.cstr
|
||||
|
||||
8
internal/runtime/c/c_default.go
Normal file
8
internal/runtime/c/c_default.go
Normal file
@@ -0,0 +1,8 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package c
|
||||
|
||||
const (
|
||||
LLGoPackage = "decl: stdio_default.ll"
|
||||
)
|
||||
9
internal/runtime/c/c_default.ll
Normal file
9
internal/runtime/c/c_default.ll
Normal file
@@ -0,0 +1,9 @@
|
||||
; ModuleID = 'github.com/goplus/llgo/internal/runtime/c'
|
||||
source_filename = "github.com/goplus/llgo/internal/runtime/c"
|
||||
|
||||
@__stderrp = external global ptr
|
||||
@__stdinp = external global ptr
|
||||
@__stdoutp = external global ptr
|
||||
@llgo_stdin = alias i8*, i8** @__stdinp
|
||||
@llgo_stdout = alias i8*, i8** @__stdoutp
|
||||
@llgo_stderr = alias i8*, i8** @__stderrp
|
||||
8
internal/runtime/c/c_linux.go
Normal file
8
internal/runtime/c/c_linux.go
Normal file
@@ -0,0 +1,8 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package c
|
||||
|
||||
const (
|
||||
LLGoPackage = "decl: stdio_linux.ll"
|
||||
)
|
||||
9
internal/runtime/c/c_linux.ll
Normal file
9
internal/runtime/c/c_linux.ll
Normal file
@@ -0,0 +1,9 @@
|
||||
; ModuleID = 'github.com/goplus/llgo/internal/runtime/c'
|
||||
source_filename = "github.com/goplus/llgo/internal/runtime/c"
|
||||
|
||||
@stderr = external global ptr
|
||||
@stdin = external global ptr
|
||||
@stdout = external global ptr
|
||||
@llgo_stdin = alias i8*, i8** @stdin
|
||||
@llgo_stdout = alias i8*, i8** @stdout
|
||||
@llgo_stderr = alias i8*, i8** @stderr
|
||||
Reference in New Issue
Block a user