Commit a6bf4746 authored by Max Kellermann's avatar Max Kellermann

test/test_byte_reverse: use gcc_alignas() for gcc<4.8 compatibility

parent 72637d00
......@@ -49,9 +49,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ByteReverseTest);
void
ByteReverseTest::TestByteReverse2()
{
static const char src[] alignas(uint16_t) = "123456";
static const char src[] gcc_alignas(uint16_t, 2) = "123456";
static const char result[] = "214365";
static uint8_t dest[ARRAY_SIZE(src)] alignas(uint16_t);
static uint8_t dest[ARRAY_SIZE(src)] gcc_alignas(uint16_t, 2);
reverse_bytes(dest, (const uint8_t *)src,
(const uint8_t *)(src + ARRAY_SIZE(src) - 1), 2);
......@@ -73,9 +73,9 @@ ByteReverseTest::TestByteReverse3()
void
ByteReverseTest::TestByteReverse4()
{
static const char src[] alignas(uint32_t) = "12345678";
static const char src[] gcc_alignas(uint32_t, 4) = "12345678";
static const char result[] = "43218765";
static uint8_t dest[ARRAY_SIZE(src)] alignas(uint32_t);
static uint8_t dest[ARRAY_SIZE(src)] gcc_alignas(uint32_t, 4);
reverse_bytes(dest, (const uint8_t *)src,
(const uint8_t *)(src + ARRAY_SIZE(src) - 1), 4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment