]> git.ozlabs.org Git - ccan/blobdiff - ccan/tcon/tcon.h
tcon: Add tcon_sizeof() helper
[ccan] / ccan / tcon / tcon.h
index a256f1031486513e6c5057f0ef918170701223ea..62bacf537b4261e2095fa59b35e0be51df7ff981 100644 (file)
 #define tcon_type(x, canary) void *
 #endif
 
+/**
+ * tcon_sizeof - the size of type within a container
+ * @x: the structure containing the TCON.
+ * @canary: which canary to check against.
+ */
+#define tcon_sizeof(x, canary) sizeof((x)->_tcon[0].canary)
+
 /**
  * tcon_ptr_type - pointer to the type within a container (or void *)
  * @x: the structure containing the TCON.