builtin: add V64_PRINTFORMAT (part 2)

pull/3907/head
Delyan Angelov 2020-03-01 16:48:54 +02:00 committed by GitHub
parent 2700fd712b
commit 615a4b3452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ pub fn (n i64) hex() string {
hex := malloc(len)
// TODO
//count := C.sprintf(charptr(hex), '0x%'C.PRIx64, n)
count := C.sprintf(charptr(hex), '0x%llx', n)
count := C.sprintf(charptr(hex), C.V64_PRINTFORMAT, n)
return tos(hex, count)
}
@ -166,7 +166,7 @@ pub fn (n u64) hex() string {
len := if n > 0 { n.str().len + 3 } else { 19 }
hex := malloc(len)
//count := C.sprintf(charptr(hex), '0x%'C.PRIx64, n)
count := C.sprintf(charptr(hex), '0x%llx', n)
count := C.sprintf(charptr(hex), C.V64_PRINTFORMAT, n)
//count := C.sprintf(charptr(hex), '0x%lx', n)
return tos(hex, count)
}