-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 branch information
1 parent
eb65f30
commit ad7c966
Showing
1 changed file
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters