OSDN Git Service

Fix build with -std=c11
authorTom Anderson <thomasanderson@chromium.org>
Wed, 25 Jul 2018 19:06:29 +0000 (12:06 -0700)
committerEric Engestrom <eric.engestrom@intel.com>
Wed, 5 Sep 2018 12:09:29 +0000 (13:09 +0100)
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>
util_math.h

index 02b15a8..35bf451 100644 (file)
@@ -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_*/