diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-22 00:48:06 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-22 00:48:06 +0200 |
commit | f832e4a373e04f77c6a1736cb63b891fcd2fe968 (patch) | |
tree | 06c3c6b7f4d66d664edd7e92c81f4683cfa34de5 /src/libmdsserver/macros.h | |
parent | typo + mds-colour: print colour list on SIGINFO (diff) | |
download | mds-f832e4a373e04f77c6a1736cb63b891fcd2fe968.tar.gz mds-f832e4a373e04f77c6a1736cb63b891fcd2fe968.tar.bz2 mds-f832e4a373e04f77c6a1736cb63b891fcd2fe968.tar.xz |
ensure that all PF_ and AF_ aliases exists if any exist
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/libmdsserver/macros.h | 43 |
1 files changed, 43 insertions, 0 deletions
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 <unistd.h> #include <time.h> #include <stddef.h> +#include <sys/socket.h> /* #include <pthread.h> @@ -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 |