util: use c11 alignof instead of our own
...with an exception for MSVC, which doesn't have stdalign.h, so let's add a definition for that. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>
This commit is contained in:
parent
e83f13c04e
commit
3a62badb2e
|
@ -410,13 +410,11 @@ u_uintN_max(unsigned bit_size)
|
|||
return UINT64_MAX >> (64 - bit_size);
|
||||
}
|
||||
|
||||
#if !defined(alignof) && !defined(__cplusplus)
|
||||
#if __STDC_VERSION__ >= 201112L
|
||||
#define alignof(t) _Alignof(t)
|
||||
#elif defined(_MSC_VER)
|
||||
#define alignof(t) __alignof(t)
|
||||
#ifndef __cplusplus
|
||||
#ifdef _MSC_VER
|
||||
#define alignof _Alignof
|
||||
#else
|
||||
#define alignof(t) __alignof__(t)
|
||||
#include <stdalign.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue