diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-13 10:56:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-13 10:56:52 +0000 |
commit | 4c916ec8b735d1b526d7ec93b4072101bf16a2fc (patch) | |
tree | c768aeea8a3704346caa385167747aba5516b1e1 /ext/socket/rubysocket.h | |
parent | 3e86bd8f3ad76dca34a61e2f0053cbcfd18e7eae (diff) | |
download | ruby-4c916ec8b735d1b526d7ec93b4072101bf16a2fc.tar.gz |
* ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a
bug in system header of darwin 9. [ruby-core:32341]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r-- | ext/socket/rubysocket.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h index 356e6f3b1a..60ac25fbbd 100644 --- a/ext/socket/rubysocket.h +++ b/ext/socket/rubysocket.h @@ -138,6 +138,16 @@ struct sockaddr_storage { }; #endif +#if defined __APPLE__ && defined __MACH__ +/* + * CMSG_ macros are broken on 64bit darwin, because __DARWIN_ALIGN + * aligns up to __darwin_size_t which is 64bit, but CMSG_DATA is + * 32bit-aligned. + */ +#undef __DARWIN_ALIGNBYTES +#define __DARWIN_ALIGNBYTES (sizeof(unsigned int) - 1) +#endif + #if defined(_AIX) #ifndef CMSG_SPACE # define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len)) |