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:28 +0000 (11:32 -0400)
commit2a17fe10ad97e997981a98463a4cbda9b4a933a5
tree6511d1f27b09d35fab70a01ee6668fea22dc1bec
parent20865c71e59536962252babe23c8ebdbd1cc28b0
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.025152 seconds and 4 git commands to generate.