From 4efe1e7ca7ca4377b5f54e277e2d086a649c2cbd Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sun, 10 Jul 2022 12:48:12 +0400 Subject: [PATCH] Common/Network: Ensure offsetof is valid --- Source/Core/Common/Network.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/Common/Network.h b/Source/Core/Common/Network.h index 718a297f09..e3b319bc6b 100644 --- a/Source/Core/Common/Network.h +++ b/Source/Core/Common/Network.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "Common/CommonTypes.h" @@ -57,6 +58,7 @@ struct EthernetHeader u16 ethertype = 0; }; static_assert(sizeof(EthernetHeader) == EthernetHeader::SIZE); +static_assert(std::is_standard_layout_v); struct IPv4Header { @@ -79,6 +81,7 @@ struct IPv4Header IPAddress destination_addr{}; }; static_assert(sizeof(IPv4Header) == IPv4Header::SIZE); +static_assert(std::is_standard_layout_v); struct TCPHeader { @@ -101,6 +104,7 @@ struct TCPHeader u16 urgent_pointer = 0; }; static_assert(sizeof(TCPHeader) == TCPHeader::SIZE); +static_assert(std::is_standard_layout_v); struct UDPHeader { @@ -117,6 +121,7 @@ struct UDPHeader u16 checksum = 0; }; static_assert(sizeof(UDPHeader) == UDPHeader::SIZE); +static_assert(std::is_standard_layout_v); #pragma pack(push, 1) struct ARPHeader