diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-09-02 12:30:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-09-02 12:30:56 +0000 |
commit | 26682256b3094074484cb31f927be5db00f5ef04 (patch) | |
tree | 350f4f915902ed7666d86dc3590a9e1cfef347a4 /compat.h | |
parent | 5838ee1263bfa427412d389e0886f4083ce3d8d5 (diff) |
OS X CMSG_FIRSTHDR is broken.
Diffstat (limited to 'compat.h')
-rw-r--r-- | compat.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |