1 /* CC0 (Public domain) - see LICENSE file for details */
2 #ifndef CCAN_STRUCTEQ_H
3 #define CCAN_STRUCTEQ_H
7 * structeq - are two structures bitwise equal (including padding!)
8 * @a: a pointer to a structure
9 * @b: a pointer to a structure of the same type.
11 * If you *know* a structure has no padding, you can memcmp them. At
12 * least this way, the compiler will issue a warning if the structs are
15 #define structeq(a, b) \
16 (memcmp((a), (b), sizeof(*(a)) + 0 * sizeof((a) == (b))) == 0)
17 #endif /* CCAN_STRUCTEQ_H */