aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-09-02 12:30:56 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-09-02 12:30:56 +0000
commit26682256b3094074484cb31f927be5db00f5ef04 (patch)
tree350f4f915902ed7666d86dc3590a9e1cfef347a4
parent5838ee1263bfa427412d389e0886f4083ce3d8d5 (diff)
downloadrtmux-26682256b3094074484cb31f927be5db00f5ef04.tar.gz
rtmux-26682256b3094074484cb31f927be5db00f5ef04.tar.bz2
rtmux-26682256b3094074484cb31f927be5db00f5ef04.zip
OS X CMSG_FIRSTHDR is broken.
-rw-r--r--compat.h11
-rwxr-xr-xconfigure4
2 files changed, 13 insertions, 2 deletions
diff --git a/compat.h b/compat.h
index 1b0b7ab6..addf43d8 100644
--- a/compat.h
+++ b/compat.h
@@ -1,4 +1,4 @@
-/* $Id: compat.h,v 1.15 2009-08-26 09:10:47 nicm Exp $ */
+/* $Id: compat.h,v 1.16 2009-09-02 12:30:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -91,6 +91,15 @@ typedef uint64_t u_int64_t;
#include "compat/imsg.h"
#endif
+#ifdef HAVE_BROKEN_CMSG_FIRSTHDR
+/* Broken on OS X. */
+#undef CMSG_FIRSTHDR
+#define CMSG_FIRSTHDR(mhdr) \
+ ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
+ (struct cmsghdr *)(mhdr)->msg_control : \
+ (struct cmsghdr *)NULL)
+#endif
+
#ifndef INFTIM
#define INFTIM -1
#endif
diff --git a/configure b/configure
index d352d828..f16bd222 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: configure,v 1.33 2009-08-26 08:58:39 nicm Exp $
+# $Id: configure,v 1.34 2009-09-02 12:30:56 nicm Exp $
TMUX_PLATFORM=${TMUX_PLATFORM:-`uname -s`}
@@ -13,6 +13,7 @@ echo "# $TMUX_PLATFORM" >$CONFIG_MK
cat <<EOF >>$CONFIG_H
#undef HAVE_ASPRINTF
+#undef HAVE_BROKEN_CMSG_FIRSTHDR
#undef HAVE_BZERO
#undef HAVE_CRYPT_H
#undef HAVE_DAEMON
@@ -168,6 +169,7 @@ EOF
Darwin)
cat <<EOF >>$CONFIG_H
#define HAVE_ASPRINTF
+#define HAVE_BROKEN_CMSG_FIRSTHDR
#define HAVE_BZERO
#define HAVE_DAEMON
#define HAVE_FGETLN