mirror of
https://github.com/vlang/v.git
synced 2025-09-14 15:02:33 +03:00
17 lines
215 B
V
17 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)
|
|
}
|
|
}
|