From: Arran Cudbard-Bell Date: Thu, 2 Mar 2017 19:12:06 +0000 (-0500) Subject: Need to use __typeof__ to work with -std=c11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=509af45bd419b81ceee6684bc95fec22a7e4e0f1;p=thirdparty%2Ffreeradius-server.git Need to use __typeof__ to work with -std=c11 # Conflicts: # src/include/cursor.h --- diff --git a/src/include/cursor.h b/src/include/cursor.h index 4a1ed036cd8..7b03adcff8b 100644 --- a/src/include/cursor.h +++ b/src/include/cursor.h @@ -92,7 +92,7 @@ void fr_cursor_list_free(fr_cursor_t *cursor) CC_HINT(nonnull); * - The first item returned by the iterator. */ #define fr_cursor_talloc_iter_init(_cursor, _head, _iter, _ctx, _type) \ - _fr_cursor_init(_cursor, (void **)_head, offsetof(typeof(**_head), next), _iter, _ctx, #_type) + _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), _iter, _ctx, #_type) /** Initialise a cursor with a custom iterator * @@ -106,7 +106,7 @@ void fr_cursor_list_free(fr_cursor_t *cursor) CC_HINT(nonnull); * - The first item returned by the iterator. */ #define fr_cursor_iter_init(_cursor, _head, _iter, _ctx) \ - _fr_cursor_init(_cursor, (void **)_head, offsetof(typeof(**_head), next), _iter, _ctx, NULL) + _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), _iter, _ctx, NULL) /** Initialise a cursor with runtime talloc type safety checks * @@ -118,9 +118,9 @@ void fr_cursor_list_free(fr_cursor_t *cursor) CC_HINT(nonnull); * - The first item in the list. */ #define fr_cursor_talloc_init(_cursor, _head, _type) \ - _fr_cursor_init(_cursor, (void **)_head, offsetof(typeof(**_head), next), NULL, NULL, #_type) + _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), NULL, NULL, #_type) -/** Initialise a cursor with runtime talloc type safety checks +/** Initialise a cursor * * @param[in] _cursor to initialise. * @param[in] _head of item list. @@ -129,7 +129,7 @@ void fr_cursor_list_free(fr_cursor_t *cursor) CC_HINT(nonnull); * - The first item in the list. */ #define fr_cursor_init(_cursor, _head) \ - _fr_cursor_init(_cursor, (void **)_head, offsetof(typeof(**_head), next), NULL, NULL, NULL) + _fr_cursor_init(_cursor, (void **)_head, offsetof(__typeof__(**(_head)), next), NULL, NULL, NULL) void *_fr_cursor_init(fr_cursor_t *cursor, void * const *head, size_t offset, fr_cursor_iter_t iter, void const *ctx, char const *type);