diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2010-12-30 19:26:19 +0000 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2011-01-03 12:21:35 +0800 |
commit | 24b8ee2e0151c5d8b3f6b5ef1346c3144981636a (patch) | |
tree | a1fa5487b1819740f31c94af0348c7a9f85d836e /ext | |
parent | fd48e6fc7db29ebca21bc7a449aefa5c1d62b6e3 (diff) | |
download | perl-24b8ee2e0151c5d8b3f6b5ef1346c3144981636a.tar.gz |
Use HAS_SIN6_SCOPE_ID rather than glibc version testing
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Socket/Socket.xs | 10 | ||||
-rw-r--r-- | ext/Socket/t/Socket.t | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 387965e8b8..ef2778b10c 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -672,9 +672,9 @@ pack_sockaddr_in6(port, sin6_addr, scope_id=0, flowinfo=0) sin6.sin6_port = htons(port); sin6.sin6_flowinfo = htonl(flowinfo); Copy(addrbytes, &sin6.sin6_addr, sizeof(sin6.sin6_addr), char); -#if !defined(__GLIBC__) || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) +# ifdef HAS_SIN6_SCOPE_ID sin6.sin6_scope_id = scope_id; -#endif +# endif # ifdef HAS_SOCKADDR_SA_LEN sin6.sin6_len = sizeof(sin6); # endif @@ -705,11 +705,11 @@ unpack_sockaddr_in6(sin6_sv) EXTEND(SP, 4); mPUSHi(ntohs(sin6.sin6_port)); mPUSHp((char *)&sin6.sin6_addr, sizeof(sin6.sin6_addr)); -#if !defined(__GLIBC__) || (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) +# ifdef HAS_SIN6_SCOPE_ID mPUSHi(sin6.sin6_scope_id); -#else +# else mPUSHi(0); -#endif +# endif mPUSHi(ntohl(sin6.sin6_flowinfo)); #else ST(0) = (SV*)not_here("pack_sockaddr_in6"); diff --git a/ext/Socket/t/Socket.t b/ext/Socket/t/Socket.t index 3cfd840e73..d289f103a4 100644 --- a/ext/Socket/t/Socket.t +++ b/ext/Socket/t/Socket.t @@ -186,7 +186,7 @@ if($Config{d_inetntop} && $Config{d_inetaton}){ } if(defined eval { AF_INET6() } ) { - my $sin6 = pack_sockaddr_in6(0x1234, "0123456789abcdef", 567, 89); + my $sin6 = pack_sockaddr_in6(0x1234, "0123456789abcdef", 0, 89); print "not " unless sockaddr_family($sin6) == AF_INET6; print "ok 22\n"; @@ -197,7 +197,7 @@ if(defined eval { AF_INET6() } ) { print "not " unless (unpack_sockaddr_in6($sin6))[1] == "0123456789abcdef"; print "ok 24\n"; - print "not " unless (unpack_sockaddr_in6($sin6))[2] == 567; + print "not " unless (unpack_sockaddr_in6($sin6))[2] == 0; print "ok 25\n"; print "not " unless (unpack_sockaddr_in6($sin6))[3] == 89; |