From f832e4a373e04f77c6a1736cb63b891fcd2fe968 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Aug 2015 00:48:06 +0200 Subject: ensure that all PF_ and AF_ aliases exists if any exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/macros.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src') diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h index b249ff1..89db22f 100644 --- a/src/libmdsserver/macros.h +++ b/src/libmdsserver/macros.h @@ -28,6 +28,7 @@ #include #include #include +#include /* #include @@ -65,6 +66,48 @@ #endif +/* Ensure that all aliases for AF_UNIX are defined */ +#if !defined(AF_LOCAL) && !defined(AF_UNIX) && defined(AF_FILE) +# define AF_LOCAL AF_FILE +# define AF_UNIX AF_FILE +#elif !defined(AF_LOCAL) && defined(AF_UNIX) +# define AF_LOCAL AF_UNIX +#elif defined(AF_LOCAL) && !defined(AF_UNIX) +# define AF_UNIX AF_LOCAL +#endif +#if !defined(AF_FILE) && defined(AF_LOCAL) +# define AF_FILE AF_LOCAL +#endif + +/* Ensure that all aliases for PF_UNIX are defined */ +#if !defined(PF_LOCAL) && !defined(PF_UNIX) && defined(PF_FILE) +# define PF_LOCAL PF_FILE +# define PF_UNIX PF_FILE +#elif !defined(PF_LOCAL) && defined(PF_UNIX) +# define PF_LOCAL PF_UNIX +#elif defined(PF_LOCAL) && !defined(PF_UNIX) +# define PF_UNIX PF_LOCAL +#endif +#if !defined(PF_FILE) && defined(PF_LOCAL) +# define PF_FILE PF_LOCAL +#endif + +/* Ensure that all aliases for AF_NETLINK are defined */ +#if !defined(AF_NETLINK) && defined(AF_ROUTE) +# define AF_NETLINK AF_ROUTE +#elif defined(AF_NETLINK) && !defined(AF_ROUTE) +# define AF_ROUTE AF_NETLINK +#endif + +/* Ensure that all aliases for PF_NETLINK are defined */ +#if !defined(PF_NETLINK) && defined(PF_ROUTE) +# define PF_NETLINK PF_ROUTE +#elif defined(PF_NETLINK) && !defined(PF_ROUTE) +# define PF_ROUTE PF_NETLINK +#endif + + + /** * Wrapper around `asprintf` that makes sure that first * argument gets set to `NULL` on error and that zero is -- cgit v1.2.3-70-g09d2