summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-01-16 16:10:28 +0100
committerThomas Haller <thaller@redhat.com>2017-01-16 17:20:35 +0100
commit61da320d628bb8e22f59d5f1e44ea88fab81a3ee (patch)
tree24567ba561a3e5d8c34452f2810f5a2fb50d216b
parent9cf3cbfc3e5dbc6909c76bf223c2ab230b13f23a (diff)
shared: add nm_offsetofend() macro
-rw-r--r--shared/nm-utils/nm-macros-internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h
index 55abcf133b..70476b7ed0 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)))
/**