aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-22 00:48:06 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-22 00:48:06 +0200
commitf832e4a373e04f77c6a1736cb63b891fcd2fe968 (patch)
tree06c3c6b7f4d66d664edd7e92c81f4683cfa34de5
parenttypo + mds-colour: print colour list on SIGINFO (diff)
downloadmds-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>
-rw-r--r--src/libmdsserver/macros.h43
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