mirror of
https://github.com/vlang/v.git
synced 2025-09-08 23:07:19 -04:00
18 lines
215 B
V
18 lines
215 B
V
module sync
|
|
|
|
@[noreturn]
|
|
fn cpanic(res int) {
|
|
panic(unsafe { tos_clone(&u8(C.strerror(res))) })
|
|
}
|
|
|
|
@[noreturn]
|
|
fn cpanic_errno() {
|
|
cpanic(C.errno)
|
|
}
|
|
|
|
fn should_be_zero(res int) {
|
|
if res != 0 {
|
|
cpanic(res)
|
|
}
|
|
}
|