diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-05-10 12:29:47 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-05-10 12:30:50 +1000 |
commit | 89490d2b344c671721744d7cd4c3a98d14fcfee3 (patch) | |
tree | f36a70c721d13cd5b0fccda80b10dff91bf8b099 /src | |
parent | e877fd605cd99d5ebfc069e285944d31fe67ddd7 (diff) |
util: drop GCC specifics for container_of
clang supports __typeof__ which was the only real difference. Not sure any
other compilers matter (that don't support __typeof__)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Tested-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libinput-util.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/libinput-util.h b/src/libinput-util.h index 4e97e01..a9a2b66 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -85,15 +85,9 @@ void list_insert(struct list *list, struct list *elm); void list_remove(struct list *elm); bool list_empty(const struct list *list); -#ifdef __GNUC__ #define container_of(ptr, sample, member) \ (__typeof__(sample))((char *)(ptr) - \ ((char *)&(sample)->member - (char *)(sample))) -#else -#define container_of(ptr, sample, member) \ - (void *)((char *)(ptr) - \ - ((char *)&(sample)->member - (char *)(sample))) -#endif #define list_for_each(pos, head, member) \ for (pos = 0, pos = container_of((head)->next, pos, member); \ |