compiler.h: Introduce caa_container_of_check_null
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Jul 2023 15:17:04 +0000 (11:17 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Jul 2023 15:32:17 +0000 (11:32 -0400)
commit664d450341874fbbe6bc85176ed3336eaecb9f4c
treed7f5c6164be070c478d602369c0ce563da0bae87
parente36d48ad1a312aa3135849e83789701a8311ba44
compiler.h: Introduce caa_container_of_check_null

The approach taken by caa_unqual_scalar_typeof requires use of _Generic
which requires full C11 support. Currently liburcu supports C99.
Therefore, this approach is not appropriate for now.

Instead, introduce caa_container_of_check_null which returns NULL if the
ptr is NULL before offsetting by the member offset.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0ac1cacc67d83bd3dad6fb6cd2e6595190735441
include/urcu/compiler.h
This page took 0.024701 seconds and 4 git commands to generate.