Unverified Commit 646bae34 by Edward Thomson Committed by GitHub

Merge pull request #6041 from Esri/duncan/typeof

Use __typeof__ GNUC keyword for ISO C compatibility
parents b6735461 6c53d6ab
......@@ -29,12 +29,6 @@
# endif
#endif
#ifdef __GNUC__
# define GIT_TYPEOF(x) (__typeof__(x))
#else
# define GIT_TYPEOF(x)
#endif
#if defined(__GNUC__)
# define GIT_ALIGN(x,size) x __attribute__ ((aligned(size)))
#elif defined(_MSC_VER)
......@@ -46,7 +40,7 @@
#if defined(__GNUC__)
# define GIT_UNUSED(x) \
do { \
typeof(x) _unused __attribute__((unused)); \
__typeof__(x) _unused __attribute__((unused)); \
_unused = (x); \
} while (0)
#else
......
......@@ -34,7 +34,7 @@
# define GIT_CONTAINER_OF(ptr, type, member) \
__builtin_choose_expr( \
__builtin_offsetof(type, member) == 0 && \
__builtin_types_compatible_p(typeof(&((type *) 0)->member), typeof(ptr)), \
__builtin_types_compatible_p(__typeof__(&((type *) 0)->member), __typeof__(ptr)), \
((type *) (ptr)), \
(void)0)
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment