mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
sys/sys: Fix __builtin_is_aligned fallback
When the compiler doesn't provide __builtin_is_aligned we use macro as a fallback. The macro was missing brackets around one argument. This could lead to incorrect results when the argument is more complex than a single stagement. Fix this by adding the needed brackets. Reviewed by: brooks, imp, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45260
This commit is contained in:
parent
53120fbb68
commit
940155d24a
1 changed files with 1 additions and 1 deletions
|
|
@ -902,7 +902,7 @@
|
|||
/* Provide fallback versions for other compilers (GCC/Clang < 10): */
|
||||
#if !__has_builtin(__builtin_is_aligned)
|
||||
#define __builtin_is_aligned(x, align) \
|
||||
(((__uintptr_t)x & ((align) - 1)) == 0)
|
||||
(((__uintptr_t)(x) & ((align) - 1)) == 0)
|
||||
#endif
|
||||
#if !__has_builtin(__builtin_align_up)
|
||||
#define __builtin_align_up(x, align) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue