-#define TABLE_FIND(TABLE, TYPE, FIELD, NAME) \
- table_find((void *)TABLE, \
- offsetof(TYPE, FIELD), \
- sizeof (TYPE), \
- sizeof TABLE / sizeof (TYPE), \
+#include <stddef.h>
+
+#define TABLE_FIND(TABLE, FIELD, NAME) \
+ table_find((void *)TABLE, \
+ offsetof(typeof((TABLE)[0]), FIELD), \
+ sizeof ((TABLE)[0]), \
+ sizeof TABLE / sizeof ((TABLE)[0]), \