libnetlink: define __aligned conditionally

On some systems (e.g. current Debian/stable) the inclusion
of utils.h pulled in some other things that may end up
defining __aligned, in a possibly different way than what
we had here.

Use our own definition only if there isn't one already.

Fixes: d5acae244f ("libnetlink: add nl_print_policy() helper")
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Johannes Berg 2020-10-26 12:32:52 +01:00 committed by Stephen Hemminger
parent eb12cc9ae1
commit 9fc5bf734f
1 changed files with 2 additions and 0 deletions

View File

@ -30,7 +30,9 @@
#include "libnetlink.h"
#include "utils.h"
#ifndef __aligned
#define __aligned(x) __attribute__((aligned(x)))
#endif
#ifndef SOL_NETLINK
#define SOL_NETLINK 270