]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Need to use __typeof__ to work with -std=c11
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 2 Mar 2017 19:12:06 +0000 (14:12 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 2 Mar 2017 19:16:13 +0000 (14:16 -0500)
# Conflicts:
# src/include/cursor.h

src/include/cursor.h

index 4a1ed036cd809485e0773346fc152c24f470bb2a..7b03adcff8be16d7754b91897d9ee770acd396f4 100644 (file)
@@ -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);