diff --git a/src/libnm-glib-aux/nm-macros-internal.h b/src/libnm-glib-aux/nm-macros-internal.h index ce2a54de91..c394a6206a 100644 --- a/src/libnm-glib-aux/nm-macros-internal.h +++ b/src/libnm-glib-aux/nm-macros-internal.h @@ -43,10 +43,6 @@ /*****************************************************************************/ -#define nm_offsetofend(t, m) (G_STRUCT_OFFSET(t, m) + sizeof(((t *) NULL)->m)) - -/*****************************************************************************/ - #define gs_free nm_auto_g_free #define gs_unref_object nm_auto_unref_object #define gs_unref_variant nm_auto_unref_variant diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index a7bfc37ea4..3bac75aa64 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -10,6 +10,7 @@ #include #include #include +#include /*****************************************************************************/ @@ -222,6 +223,14 @@ typedef uint64_t _nm_bitwise nm_be64_t; #define NM_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0])) +/*****************************************************************************/ + +#define nm_offsetof(t, m) offsetof(t, m) + +#define nm_offsetofend(t, m) (nm_offsetof(t, m) + sizeof(((t *) NULL)->m)) + +/*****************************************************************************/ + /* This does a compile time check that "type" is a suitable C type. It either * returns a compile time constant of 1 or it fails compilation. The point * is only in macros to check that a macro parameter (what we might pass to