mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
encoding/cbor: deterministically store bit sets as big endian
This commit is contained in:
@@ -541,7 +541,8 @@ marshal_into_encoder :: proc(e: Encoder, v: any) -> (err: Marshal_Error) {
|
||||
return marshal_into(e, any{v.data, info.base.id})
|
||||
|
||||
case runtime.Type_Info_Bit_Set:
|
||||
do_byte_swap := is_bit_set_different_endian_to_platform(info.underlying)
|
||||
// Store bit_set as big endian just like the protocol.
|
||||
do_byte_swap := !reflect.bit_set_is_big_endian(v)
|
||||
switch ti.size * 8 {
|
||||
case 0:
|
||||
return _encode_u8(e.writer, 0)
|
||||
|
||||
Reference in New Issue
Block a user