summaryrefslogtreecommitdiff
path: root/ext/socket/sockport.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-27 15:21:23 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-27 15:21:23 +0000
commit5fb1faf2bfc87597dbbf1a6686bab6b36482529d (patch)
tree05ecf4363780e14bd42b26d179cc1bd37ffbf46b /ext/socket/sockport.h
parentd8c66c433393cb0ff97fcbd32f6a4fdc4d8f8b79 (diff)
* ext/socket/raddrinfo.c: suppress strict-aliasing warning with
gcc version 4.4.0 20090219 (Red Hat 4.4.0-0.21) on Fedora 11 Alpha. * ext/socket/socket.c: ditto. * ext/socket/unixsocket.c: ditto. * ext/socket/sockport.h (SS_LEN): defined. (SET_SS_LEN): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/sockport.h')
-rw-r--r--ext/socket/sockport.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index d536bbf..6d3344e 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -13,22 +13,29 @@
#ifndef SA_LEN
# ifdef HAVE_SA_LEN
# define SA_LEN(sa) (sa)->sa_len
+# define SS_LEN(ss) (ss)->ss_len
# else
# ifdef AF_INET6
# define SA_LEN(sa) \
(((sa)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
: sizeof(struct sockaddr))
+# define SS_LEN(ss) \
+ (((ss)->ss_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
+ : sizeof(struct sockaddr))
# else
/* by tradition, sizeof(struct sockaddr) covers most of the sockaddrs */
# define SA_LEN(sa) (sizeof(struct sockaddr))
+# define SS_LEN(ss) (sizeof(struct sockaddr))
# endif
# endif
#endif
#ifdef HAVE_SA_LEN
# define SET_SA_LEN(sa, len) (void)((sa)->sa_len = (len))
+# define SET_SS_LEN(ss, len) (void)((ss)->ss_len = (len))
#else
# define SET_SA_LEN(sa, len) (void)(len)
+# define SET_SS_LEN(ss, len) (void)(len)
#endif
#ifdef HAVE_SIN_LEN