mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
util: add a alignof() macro
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
This commit is contained in:
parent
721cb6cc07
commit
391eeb7443
1 changed files with 10 additions and 0 deletions
|
|
@ -351,4 +351,14 @@ enum pipe_debug_type
|
||||||
PIPE_DEBUG_TYPE_CONFORMANCE,
|
PIPE_DEBUG_TYPE_CONFORMANCE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if !defined(alignof) && !defined(__cplusplus)
|
||||||
|
#if __STDC_VERSION__ >= 201112L
|
||||||
|
#define alignof(t) _Alignof(t)
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define alignof(t) __alignof(t)
|
||||||
|
#else
|
||||||
|
#define alignof(t) __alignof__(t)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* UTIL_MACROS_H */
|
#endif /* UTIL_MACROS_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue