mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
AK: Ensure unions with bitfield structs actually have correct sizes
The fun pattern of `union { struct { u32 a : 1; u64 b : 7; }; u8 x; }` produces complete garbage on windows, this commit fixes the two instances of those that exist in AK. This commit also makes sure that the generated unions have the correct size (whereas FloatExtractor<f32> previously did not!) by adding some nice static_asserts.
This commit is contained in:
parent
4676b288a2
commit
7976e1852c
2 changed files with 24 additions and 14 deletions
|
@ -13,7 +13,7 @@ VALIDATE_IS_X86();
|
|||
|
||||
namespace AK {
|
||||
|
||||
enum class RoundingMode : u8 {
|
||||
enum class RoundingMode : u16 {
|
||||
NEAREST = 0b00,
|
||||
DOWN = 0b01,
|
||||
UP = 0b10,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue