util: add type checking to CONTAINER_OF
Add a SAME_TYPE checking macro and use it to add type validation to
CONTAINER_OF. This is inspired by the Linux container_of implementation.
The check is inhibited when using C++ as __builtin_types_compatible_p is
not available there.
Signed-off-by:
Fabio Baltieri <fabiobaltieri@google.com>
Loading
Please sign in to comment