fix: stdio and typo
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
//go:build !baremetal
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ package runtime
|
|||||||
|
|
||||||
import c "github.com/goplus/llgo/runtime/internal/clite"
|
import c "github.com/goplus/llgo/runtime/internal/clite"
|
||||||
|
|
||||||
|
var (
|
||||||
|
printFormatPrefixInt = c.Str("%ld")
|
||||||
|
printFormatPrefixUInt = c.Str("%lu")
|
||||||
|
printFormatPrefixHex = c.Str("%lx")
|
||||||
|
)
|
||||||
|
|
||||||
// Rethrow rethrows a panic.
|
// Rethrow rethrows a panic.
|
||||||
func Rethrow(link *Defer) {
|
func Rethrow(link *Defer) {
|
||||||
// in baremetal environment, we cannot get debug data from pthread_getspecific
|
// in baremetal environment, we cannot get debug data from pthread_getspecific
|
||||||
@@ -8,6 +8,12 @@ import (
|
|||||||
"github.com/goplus/llgo/runtime/internal/clite/pthread"
|
"github.com/goplus/llgo/runtime/internal/clite/pthread"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
printFormatPrefixInt = c.Str("%lld")
|
||||||
|
printFormatPrefixUInt = c.Str("%llu")
|
||||||
|
printFormatPrefixHex = c.Str("%llx")
|
||||||
|
)
|
||||||
|
|
||||||
// Rethrow rethrows a panic.
|
// Rethrow rethrows a panic.
|
||||||
func Rethrow(link *Defer) {
|
func Rethrow(link *Defer) {
|
||||||
if ptr := excepKey.Get(); ptr != nil {
|
if ptr := excepKey.Get(); ptr != nil {
|
||||||
@@ -70,15 +70,15 @@ func PrintComplex(v complex128) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func PrintUint(v uint64) {
|
func PrintUint(v uint64) {
|
||||||
c.Fprintf(c.Stderr, c.Str("%llu"), v)
|
c.Fprintf(c.Stderr, printFormatPrefixUInt, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func PrintInt(v int64) {
|
func PrintInt(v int64) {
|
||||||
c.Fprintf(c.Stderr, c.Str("%lld"), v)
|
c.Fprintf(c.Stderr, printFormatPrefixInt, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func PrintHex(v uint64) {
|
func PrintHex(v uint64) {
|
||||||
c.Fprintf(c.Stderr, c.Str("%llx"), v)
|
c.Fprintf(c.Stderr, printFormatPrefixHex, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func PrintPointer(p unsafe.Pointer) {
|
func PrintPointer(p unsafe.Pointer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user