diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-02-04 10:33:56 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-02-04 10:36:05 +0200 |
commit | d60477751f374a2d58dc73f64dca4ff95ea39a00 (patch) | |
tree | 45cbc37d4e7ae1b7b95bef8f3d27e0287b07bf16 /src | |
parent | 45d313c51cbae20bce0789db86ba82ff79c9b202 (diff) | |
download | apk-tools-d60477751f374a2d58dc73f64dca4ff95ea39a00.tar.gz apk-tools-d60477751f374a2d58dc73f64dca4ff95ea39a00.tar.bz2 apk-tools-d60477751f374a2d58dc73f64dca4ff95ea39a00.tar.xz apk-tools-d60477751f374a2d58dc73f64dca4ff95ea39a00.zip |
defines: add typeof() as it's gcc built-in
Related to MR !15
Diffstat (limited to 'src')
-rw-r--r-- | src/apk_defines.h | 4 |
1 files changed, 4 insertions, 0 deletions
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); \ |