Skip to content
Commit 9c5dafed authored by Fabio Baltieri's avatar Fabio Baltieri Committed by Carles Cufí
Browse files

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: default avatarFabio Baltieri <fabiobaltieri@google.com>
parent 48c56ceb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment