Fix build with -std=c11

typeof() is a GNU extension that will only work when the compiler is passed
-std=gnu*.  __typeof__() works with -std=c*, however.
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
main
Tom Anderson 2018-07-25 12:06:29 -07:00 committed by Eric Engestrom
parent 4a9030dc8b
commit b06d71bb22
1 changed files with 1 additions and 1 deletions

View File

@ -29,6 +29,6 @@
#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C)) #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
#define __align_mask(value, mask) (((value) + (mask)) & ~(mask)) #define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
#define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1)) #define ALIGN(value, alignment) __align_mask(value, (__typeof__(value))((alignment) - 1))
#endif /*_UTIL_MATH_H_*/ #endif /*_UTIL_MATH_H_*/