diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 93d4acb3f..b053923df 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -100,6 +100,8 @@ struct BEInt BEInt () = default; constexpr BEInt (Type V) : v {uint8_t ((V >> 8) & 0xFF), uint8_t ((V ) & 0xFF)} {} + + struct __attribute__((packed)) packed_uint16_t { uint16_t v; }; constexpr operator Type () const { #if ((defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__)) && \ @@ -107,7 +109,6 @@ struct BEInt (__BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __BIG_ENDIAN) /* Spoon-feed the compiler a big-endian integer with alignment 1. * https://github.com/harfbuzz/harfbuzz/pull/1398 */ - struct __attribute__((packed)) packed_uint16_t { uint16_t v; }; #if __BYTE_ORDER == __LITTLE_ENDIAN return __builtin_bswap16 (((packed_uint16_t *) this)->v); #else /* __BYTE_ORDER == __BIG_ENDIAN */