util: use c11 alignas instead of rolling our own

Due to how alignas is defined, it itsn't allowed to use it on a struct,
it needs to be used on the first member instead. So move the declaration
in those cases.

This still leaves the ALIGN16 macro using compiler-specific directives,
because it's a lot of work to untangle the above. This probably deserves
its own MR.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>
This commit is contained in:
Erik Faye-Lund
2022-06-08 10:07:15 +02:00
committed by Marge Bot
parent 2c43044507
commit e3bc78b8e3
4 changed files with 18 additions and 29 deletions

View File

@@ -413,6 +413,7 @@ u_uintN_max(unsigned bit_size)
#ifndef __cplusplus
#ifdef _MSC_VER
#define alignof _Alignof
#define alignas _Alignas
#else
#include <stdalign.h>
#endif