Provide a compatible declaration of CMSG_ALIGN
authorJakub Hrozek <jakub.hrozek@gmail.com>
Thu, 2 Oct 2014 05:05:35 +0000 (07:05 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 2 Oct 2014 07:35:10 +0000 (09:35 +0200)
Some platforms (like OSX) do support some of the CMGS macros, but don't
have a CMSG_ALIGN macro of their own.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/socket_wrapper/socket_wrapper.c

index 903eec2..930ab58 100644 (file)
@@ -3336,7 +3336,7 @@ int ioctl(int s, unsigned long int r, ...)
 # ifdef _ALIGN /* BSD */
 #define CMSG_ALIGN _ALIGN
 # else
-#error NO_CMSG_ALIGN
+#define CMSG_ALIGN(len) (((len) + sizeof(size_t) - 1) & ~(sizeof(size_t) - 1))
 # endif /* _ALIGN */
 #endif /* CMSG_ALIGN */