X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Futil.h;h=49790490614b3d773d014d36abac69fc0da68bbe;hb=eb9b830766044475277a590dbf8d213b77b62188;hp=29e212dc52cc9d1e6194f637d46f48635fd5c629;hpb=17e42975c2d42574072925f3743cc64bfd5a8fc1;p=openvswitch diff --git a/lib/util.h b/lib/util.h index 29e212dc..49790490 100644 --- a/lib/util.h +++ b/lib/util.h @@ -101,6 +101,14 @@ extern const char *program_name; ((OVS_TYPEOF(OBJECT)) (void *) \ ((char *) (POINTER) - ((char *) &(OBJECT)->MEMBER - (char *) (OBJECT)))) +/* Given POINTER, the address of the given MEMBER within an object of the type + * that that OBJECT points to, assigns the address of the outer object to + * OBJECT, which must be an lvalue. + * + * Evaluates to 1. */ +#define ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER) \ + ((OBJECT) = OBJECT_CONTAINING(POINTER, OBJECT, MEMBER), 1) + #ifdef __cplusplus extern "C" { #endif