From 61da320d628bb8e22f59d5f1e44ea88fab81a3ee Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 16 Jan 2017 16:10:28 +0100 Subject: [PATCH] shared: add nm_offsetofend() macro --- shared/nm-utils/nm-macros-internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h index 55abcf133..70476b7ed 100644 --- a/shared/nm-utils/nm-macros-internal.h +++ b/shared/nm-utils/nm-macros-internal.h @@ -36,6 +36,8 @@ #define _nm_const __attribute__ ((const)) #define _nm_printf(a,b) __attribute__ ((__format__ (__printf__, a, b))) +#define nm_offsetofend(t,m) (G_STRUCT_OFFSET (t,m) + sizeof (((t *) NULL)->m)) + #define nm_auto(fcn) __attribute__ ((cleanup(fcn))) /**