mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
vlib: add unsafe{} wrappers to C. fn calls, to allow compiling with -prod again
This commit is contained in:
parent
6dbc143d67
commit
0af415fa28
6 changed files with 14 additions and 14 deletions
|
@ -20,7 +20,7 @@ fn htonl64(payload_len u64) byteptr {
|
|||
fn create_masking_key() []byte {
|
||||
mask_bit := byte(rand.intn(255))
|
||||
buf := [`0`].repeat(4)
|
||||
C.memcpy(buf.data, &mask_bit, 4)
|
||||
unsafe { C.memcpy(buf.data, &mask_bit, 4) }
|
||||
return buf
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue