summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-15 11:43:58 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-15 11:43:58 +0000
commit33ed9f92bae61171cd7e9db262efff353e8cbe33 (patch)
treec98b9644e65104f54732a0dd054aafd3017c5dd6
parent8ff17ef26936f3bc4f0fec430fe4cdb56f069a33 (diff)
merges r29242 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@29796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/extconf.rb3
-rw-r--r--ext/socket/rubysocket.h10
-rw-r--r--version.h2
4 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c0248c5c8d..2af9c9ef4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Sep 13 19:56:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of a
+ bug in system header of darwin 9. [ruby-core:32341]
+
Mon Sep 13 10:12:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
* util.c (ruby_strtod): reject Float('0x0.').
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 7c31030d72..a6bc9bb46c 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -117,8 +117,7 @@ if !have_macro("IPPROTO_IPV6", headers) && have_const("IPPROTO_IPV6", headers)
}
end
-if (have_func("sendmsg") | have_func("recvmsg")) && /64-darwin/ !~ RUBY_PLATFORM
- # CMSG_ macros are broken on 64bit darwin, because of use of __DARWIN_ALIGN.
+if have_func("sendmsg") | have_func("recvmsg")
have_struct_member('struct msghdr', 'msg_control', ['sys/types.h', 'sys/socket.h'])
have_struct_member('struct msghdr', 'msg_accrights', ['sys/types.h', 'sys/socket.h'])
end
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))
diff --git a/version.h b/version.h
index 8a05f44a8f..dd790f0fdf 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 40
+#define RUBY_PATCHLEVEL 41
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1