From ee5c998ed76d96afcb5b0065564399d7e21fed95 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 30 Oct 2021 22:24:48 -0400 Subject: [PATCH] Make dsp::int24_t compile on Windows GCC. --- include/dsp/convert.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/dsp/convert.hpp b/include/dsp/convert.hpp index 15893a0e..27c5cf86 100644 --- a/include/dsp/convert.hpp +++ b/include/dsp/convert.hpp @@ -8,11 +8,12 @@ namespace dsp { /** 24-bit integer, using int32_t for conversions. */ -struct __attribute__((packed)) int24_t { +struct int24_t { int32_t i : 24; + int24_t() {} int24_t(int32_t i) : i(i) {} operator int32_t() {return i;} -}; +} __attribute__((packed, aligned(1), gcc_struct)); static_assert(sizeof(int24_t) == 3, "int24_t type must be 3 bytes");