From d60477751f374a2d58dc73f64dca4ff95ea39a00 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Tue, 4 Feb 2020 10:33:56 +0200 Subject: defines: add typeof() as it's gcc built-in Related to MR !15 --- src/apk_defines.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/apk_defines.h b/src/apk_defines.h index 1a84ea0..5373725 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -54,6 +54,10 @@ static inline int IS_ERR_OR_NULL(const void *ptr) { return IS_ERR(ptr) || !ptr; #define unlikely(x) __builtin_expect((!!(x)),0) #endif +#ifndef typeof +#define typeof(x) __typeof__(x) +#endif + #ifndef container_of #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ -- cgit v1.2.3-70-g09d2