Do not break non-GCC/g++ compilers.

This commit is contained in:
Peter Pentchev 2021-08-20 17:21:26 +03:00
parent 0e9624f69f
commit 6e686af8b5

View File

@ -14,6 +14,14 @@
#include <cstring> #include <cstring>
#include <limits> #include <limits>
#ifndef __packed
#if defined(__GNUC__)
#define __packed __attribute__((packed))
#else
#define __packed
#endif
#endif
namespace Kakoune namespace Kakoune
{ {
@ -82,7 +90,7 @@ struct ParsedRegex
Codepoint value; Codepoint value;
Quantifier quantifier; Quantifier quantifier;
uint16_t filler = 0; uint16_t filler = 0;
} __attribute__((packed)); } __packed;
static_assert(sizeof(Node) == 16, ""); static_assert(sizeof(Node) == 16, "");
Vector<Node, MemoryDomain::Regex> nodes; Vector<Node, MemoryDomain::Regex> nodes;