llgo cmptest (#391)

This commit is contained in:
xushiwei
2024-06-23 00:48:20 +08:00
parent 24d345a970
commit cd6d4021b1
9 changed files with 112 additions and 44 deletions

View File

@@ -22,16 +22,19 @@ import (
"github.com/goplus/llgo/c"
)
func PrintByte(v byte) {
c.Fputc(c.Int(v), c.Stderr)
func boolCStr(v bool) *c.Char {
if v {
return c.Str("true")
}
return c.Str("false")
}
func PrintBool(v bool) {
if v {
c.Fprintf(c.Stderr, c.Str("true"))
} else {
c.Fprintf(c.Stderr, c.Str("false"))
}
c.Fprintf(c.Stderr, boolCStr(v))
}
func PrintByte(v byte) {
c.Fputc(c.Int(v), c.Stderr)
}
func PrintFloat(v float64) {