From: Tom Anderson Date: Wed, 25 Jul 2018 19:06:29 +0000 (-0700) Subject: Fix build with -std=c11 X-Git-Tag: android-x86-8.1-r1~71 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-libdrm.git;a=commitdiff_plain;h=b06d71bb2244d20ee3643c47c0de5f9d98b99ef5 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 --- diff --git a/util_math.h b/util_math.h index 02b15a8e..35bf4512 100644 --- a/util_math.h +++ b/util_math.h @@ -29,6 +29,6 @@ #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C)) #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_*/