builtin: define C.abs()

Alexander Medvednikov 2022-04-20 13:03:22 +03:00 committed by Jef Roosens
parent ae3906141d
commit fac15fb862
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 2 additions and 1 deletions

View File

@ -53,6 +53,7 @@ fn C.chmod(&char, u32) int
fn C.printf(&char, ...voidptr) int
fn C.puts(&char) int
fn C.abs(f64) f64
fn C.fputs(str &char, stream &C.FILE) int

View File

@ -69,7 +69,7 @@ fn (mut p Parser) array_init() ast.ArrayInit {
// [100]u8
elem_type = p.parse_type()
if p.table.sym(elem_type).name == 'byte' {
p.error('`byte` has been deprecated in favor of `u8`: use `[10]u8` instead of `[10]byte`')
p.error('`byte` has been deprecated in favor of `u8`: use `[10]u8{}` instead of `[10]byte{}`')
}
last_pos = p.tok.pos()
is_fixed = true