]> git.sesse.net Git - vlc/blobdiff - bin/rootwrap.c
Solaris needs _XPG4_2 for ancilliary data (fixes: #3040)
[vlc] / bin / rootwrap.c
index f2c851a3544347ea5cdc522cf29a62f3f68c49e8..b88d1ee22d8b37b215411a18e12855593f234dbb 100644 (file)
@@ -21,6 +21,7 @@
 #if HAVE_CONFIG_H
 # include <config.h>
 #endif
+#define _XPG4_2 /* ancilliary data on Solaris */
 
 #include <stdlib.h> /* exit() */
 #include <stdio.h>
 #ifndef AF_LOCAL
 # define AF_LOCAL AF_UNIX
 #endif
+/* Required yet non-standard cmsg functions */
+#ifndef CMSG_ALIGN
+# define CMSG_ALIGN(len) (((len) + sizeof(intptr_t)-1) & ~(sizeof(intptr_t)-1))
+#endif
+#ifndef CMSG_SPACE
+# define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+#endif
+#ifndef CMSG_LEN
+# define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
 
 static inline int is_allowed_port (uint16_t port)
 {