summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-10-17 19:59:33 +0200
committerThomas Haller <thaller@redhat.com>2017-10-17 20:02:59 +0200
commitbdb8e65434e1556f0022c2f1fc5a1427e36b0976 (patch)
tree1eecd92adb5f2ad94e70d1cf38366a24c7de3243
parente71f7775a7b28957a0f6522135b6386edebd7889 (diff)
downloadNetworkManager-bdb8e65434e1556f0022c2f1fc5a1427e36b0976.tar.gz
shared: add _nm_align() and _nm_alignof() macros
-rw-r--r--shared/nm-utils/nm-macros-internal.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h
index 6b70693258..352e581365 100644
--- a/shared/nm-utils/nm-macros-internal.h
+++ b/shared/nm-utils/nm-macros-internal.h
@@ -26,11 +26,14 @@
#include <stdlib.h>
#include <errno.h>
-#define _nm_packed __attribute__ ((packed))
-#define _nm_unused __attribute__ ((unused))
-#define _nm_pure __attribute__ ((pure))
-#define _nm_const __attribute__ ((const))
-#define _nm_printf(a,b) __attribute__ ((__format__ (__printf__, a, b)))
+#define _nm_packed __attribute__ ((packed))
+#define _nm_unused __attribute__ ((unused))
+#define _nm_pure __attribute__ ((pure))
+#define _nm_const __attribute__ ((const))
+#define _nm_printf(a,b) __attribute__ ((__format__ (__printf__, a, b)))
+#define _nm_align(s) __attribute__ ((aligned (s)))
+#define _nm_alignof(type) __alignof (type)
+#define _nm_alignas(type) _nm_align (_nm_alignof (type))
/*****************************************************************************/