diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-04-07 16:21:25 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-04-07 16:21:33 +0300 |
commit | ace64897d47b9bc7af277d8a3f8a0ff67976cba8 (patch) | |
tree | d540055780c8cedf76712c040e0906a722163e1a /list.h | |
parent | 92009b7f989f83f83159a43574ce5e36b7c4d5a1 (diff) |
switch from typeof to the more portable __typeof__
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'list.h')
-rw-r--r-- | list.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -37,7 +37,7 @@ #ifndef container_of #define container_of(ptr, type, member) \ ({ \ - const typeof(((type *) NULL)->member) *__mptr = (ptr); \ + const __typeof__(((type *) NULL)->member) *__mptr = (ptr); \ (type *) ((char *) __mptr - offsetof(type, member)); \ }) #endif @@ -120,17 +120,17 @@ list_del_init(struct list_head *entry) for (p = (head)->next, n = p->next; p != (head); p = n, n = p->next) #define list_for_each_entry(p, h, field) \ - for (p = list_first_entry(h, typeof(*p), field); &p->field != (h); \ - p = list_entry(p->field.next, typeof(*p), field)) + for (p = list_first_entry(h, __typeof__(*p), field); &p->field != (h); \ + p = list_entry(p->field.next, __typeof__(*p), field)) #define list_for_each_entry_safe(p, n, h, field) \ - for (p = list_first_entry(h, typeof(*p), field), \ - n = list_entry(p->field.next, typeof(*p), field); &p->field != (h);\ - p = n, n = list_entry(n->field.next, typeof(*n), field)) + for (p = list_first_entry(h, __typeof__(*p), field), \ + n = list_entry(p->field.next, __typeof__(*p), field); &p->field != (h);\ + p = n, n = list_entry(n->field.next, __typeof__(*n), field)) #define list_for_each_entry_reverse(p, h, field) \ - for (p = list_last_entry(h, typeof(*p), field); &p->field != (h); \ - p = list_entry(p->field.prev, typeof(*p), field)) + for (p = list_last_entry(h, __typeof__(*p), field); &p->field != (h); \ + p = list_entry(p->field.prev, __typeof__(*p), field)) #define list_for_each_prev(p, h) for (p = (h)->prev; p != (h); p = p->prev) #define list_for_each_prev_safe(p, n, h) for (p = (h)->prev, n = p->prev; p != (h); p = n, n = p->prev) |