1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: make bools take up a single byte, not 4 (#9352)

This commit is contained in:
spaceface
2021-03-18 15:23:29 +01:00
committed by GitHub
parent 4ae2c22c18
commit 624c1f3bcf
4 changed files with 13 additions and 11 deletions

View File

@ -211,7 +211,8 @@ pub fn (mut s UdpSocket) set_option_bool(opt SocketOption, value bool) ? {
// if opt !in opts_bool {
// return err_option_wrong_type
// }
socket_error(C.setsockopt(s.handle, C.SOL_SOCKET, int(opt), &value, sizeof(bool))) ?
x := int(value)
socket_error(C.setsockopt(s.handle, C.SOL_SOCKET, int(opt), &x, sizeof(int))) ?
return none
}