Handle endianness for floats

This commit is contained in:
gingerBill
2026-03-13 11:10:28 +00:00
parent 987aa04d6c
commit b5801ea5c1

View File

@@ -454,6 +454,8 @@ is_endian_platform :: proc(info: ^Type_Info) -> bool {
#partial switch v in info.variant {
case Type_Info_Integer:
return v.endianness == .Platform
case Type_Info_Float:
return v.endianness == .Platform
case Type_Info_Bit_Set:
return is_endian_platform(v.underlying)
case Type_Info_Pointer:
@@ -476,6 +478,11 @@ is_endian_little :: proc(info: ^Type_Info) -> bool {
return ODIN_ENDIAN == .Little
}
return v.endianness == .Little
case Type_Info_Float:
if v.endianness == .Platform {
return ODIN_ENDIAN == .Little
}
return v.endianness == .Little
case Type_Info_Bit_Set:
return is_endian_little(v.underlying)
case Type_Info_Pointer:
@@ -498,6 +505,11 @@ is_endian_big :: proc(info: ^Type_Info) -> bool {
return ODIN_ENDIAN == .Big
}
return v.endianness == .Big
case Type_Info_Float:
if v.endianness == .Platform {
return ODIN_ENDIAN == .Big
}
return v.endianness == .Big
case Type_Info_Bit_Set:
return is_endian_big(v.underlying)
case Type_Info_Pointer: