6 * structeq - bitwise comparison of structs.
8 * This is a replacement for memcmp, which checks the argument types are the
11 * License: CC0 (Public domain)
12 * Author: Rusty Russell <rusty@rustcorp.com.au>
15 * #include <ccan/structeq/structeq.h>
16 * #include <ccan/build_assert/build_assert.h>
27 * // No padding in struct, otherwise this doesn't work!
28 * BUILD_ASSERT(sizeof(a) == sizeof(a.start) + sizeof(a.end));
37 * assert(structeq(&a, &b));
40 * // Now they are not.
41 * assert(!structeq(&a, &b));
46 int main(int argc, char *argv[])
48 /* Expect exactly one argument */
52 if (strcmp(argv[1], "depends") == 0) {