Module: Mesa Branch: main Commit: 3a62badb2e1606274f7e36302c96b96f57e90b2d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a62badb2e1606274f7e36302c96b96f57e90b2d
Author: Erik Faye-Lund <[email protected]> Date: Tue Jun 7 16:33:02 2022 +0200 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908> --- src/util/macros.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/util/macros.h b/src/util/macros.h index 22b18303826..e0af384f7b9 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -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
