mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
Merge pull request #279 from NeRdTheNed/master
Check for builtin before using it
This commit is contained in:
@@ -32,12 +32,16 @@
|
|||||||
# define CGLM_ALIGN_MAT CGLM_ALIGN(16)
|
# define CGLM_ALIGN_MAT CGLM_ALIGN(16)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#if defined(__has_builtin)
|
||||||
|
# if __has_builtin(__builtin_assume_aligned)
|
||||||
# define CGLM_ASSUME_ALIGNED(expr, alignment) \
|
# define CGLM_ASSUME_ALIGNED(expr, alignment) \
|
||||||
__builtin_assume_aligned((expr), (alignment))
|
__builtin_assume_aligned((expr), (alignment))
|
||||||
# else
|
# else
|
||||||
# define CGLM_ASSUME_ALIGNED(expr, alignment) (expr)
|
# define CGLM_ASSUME_ALIGNED(expr, alignment) (expr)
|
||||||
# endif
|
# endif
|
||||||
|
#else
|
||||||
|
# define CGLM_ASSUME_ALIGNED(expr, alignment) (expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CGLM_CASTPTR_ASSUME_ALIGNED(expr, type) \
|
#define CGLM_CASTPTR_ASSUME_ALIGNED(expr, type) \
|
||||||
((type*)CGLM_ASSUME_ALIGNED((expr), __alignof__(type)))
|
((type*)CGLM_ASSUME_ALIGNED((expr), __alignof__(type)))
|
||||||
|
|||||||
Reference in New Issue
Block a user