X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fcompiler.h;h=f8fce5a6b46558fa4a4b2d50f78f91eecf229c90;hp=489677b3aefe1ad6dd294006d903721f375f66a7;hb=b194c06ef206b0fcf7f1e646fe7c1e8afa8766ce;hpb=9380711ae3803da72aa1c7cf9ade5c3f93757006 diff --git a/urcu/compiler.h b/urcu/compiler.h index 489677b..f8fce5a 100644 --- a/urcu/compiler.h +++ b/urcu/compiler.h @@ -55,9 +55,16 @@ #define CAA_BITS_PER_LONG 32 #endif -#define caa_container_of(ptr, type, member) \ +/* + * caa_container_of - Get the address of an object containing a field. + * + * @ptr: pointer to the field. + * @type: type of the object. + * @member: name of the field within the object. + */ +#define caa_container_of(ptr, type, member) \ ({ \ - const typeof(((type *)NULL)->member) * __ptr = (ptr); \ + const typeof(((type *) NULL)->member) * __ptr = (ptr); \ (type *)((char *)__ptr - offsetof(type, member)); \ })