Update of /cvsroot/tmux/tmux
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30539

Modified Files:
        compat.h 
Log Message:
Solaris 9 is missing CMSG_ALIGN and some of the RFC2292 CMSG_*. From
Dagobert Michelsen.




Index: compat.h
===================================================================
RCS file: /cvsroot/tmux/tmux/compat.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- compat.h    19 May 2010 21:31:37 -0000      1.21
+++ compat.h    19 May 2010 21:40:49 -0000      1.22
@@ -84,14 +84,31 @@
 #endif
 
 #ifdef HAVE_BROKEN_CMSG_FIRSTHDR
-/* Broken on OS X. */
+/* CMSG_FIRSTHDR broken on OS X. */
 #undef CMSG_FIRSTHDR
 #define CMSG_FIRSTHDR(mhdr) \
-        ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
-           (struct cmsghdr *)(mhdr)->msg_control : \
+       ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
+           (struct cmsghdr *)(mhdr)->msg_control :         \
            (struct cmsghdr *)NULL)
 #endif
 
+/* CMSG_ALIGN, CMSG_SPACE, CMSG_LEN missing from Solaris 9. */
+#ifndef CMSG_ALIGN
+#ifdef __sun
+#define CMSG_ALIGN _CMSG_DATA_ALIGN
+#else
+#define CMSG_ALIGN(len) (((len) + sizeof(long) - 1) & ~(sizeof(long) - 1))
+#endif
+#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
+
 #ifndef INFTIM
 #define INFTIM -1
 #endif
@@ -135,7 +152,7 @@
 #endif
 
 #ifndef HAVE_BZERO
-#define bzero(buf, len) memset((buf), 0, (len));
+#define bzero(buf, len) memset(buf, 0, len);
 #endif
 
 #ifndef HAVE_STRCASESTR


------------------------------------------------------------------------------

_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to