#
#	gio/gsocket.h
#	add missing CMSG_LEN & CMSG_SPACE macros
#
--- glib-2.23.0/gio/gsocket.h.old	2009-08-28 19:52:22.000000000 -0700
+++ glib-2.23.0/gio/gsocket.h	2009-12-17 10:09:24.371768001 -0800
@@ -29,6 +29,22 @@
 #ifndef __G_SOCKET_H__
 #define __G_SOCKET_H__
 
+#ifndef CMSG_ALIGN
+#define CMSG_ALIGN(len) (((len) + sizeof (socklen_t) - 1) \
+                         & (socklen_t) ~(sizeof (socklen_t) - 1))
+#endif
+
+/* Length of the contents of a control message of length len */
+#ifndef CMSG_LEN
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+#endif
+
+/* Length of the space taken up by a padded control message of length len */
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+                         + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#endif
+
 #include <gio/giotypes.h>
 
 G_BEGIN_DECLS
