Analogous to offsetof but returns structure offset after the specified
field. Useful for checking whether specific field is present in obtained
data or specifying amount of data to copy based on the (last) field needed.
* defs.h (offsetofend): New macro.
extern char *stpcpy(char *dst, const char *src);
#endif
+#ifndef offsetofend
+# define offsetofend(type, member) \
+ (offsetof(type, member) + sizeof(((type *)NULL)->member))
+#endif
+
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
/* macros */