From aa88f459ffd26d82c7b6ffc22764fa53821e3b9a Mon Sep 17 00:00:00 2001 From: Peter Pentchev Date: Sat, 21 Aug 2021 17:06:14 +0300 Subject: [PATCH] Use the [[gnu::packed]] C++ attribute. Suggested by: Maxime Coste --- src/regex_impl.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/regex_impl.cc b/src/regex_impl.cc index ee560d21..16b22681 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -14,14 +14,6 @@ #include #include -#ifndef __packed -#if defined(__GNUC__) -#define __packed __attribute__((packed)) -#else -#define __packed -#endif -#endif - namespace Kakoune { @@ -82,7 +74,7 @@ struct ParsedRegex }; using NodeIndex = uint16_t; - struct Node + struct [[gnu::packed]] Node { Op op; bool ignore_case; @@ -90,7 +82,7 @@ struct ParsedRegex Codepoint value; Quantifier quantifier; uint16_t filler = 0; - } __packed; + }; static_assert(sizeof(Node) == 16, ""); Vector nodes;