summaryrefslogtreecommitdiff
path: root/ext/Socket
diff options
context:
space:
mode:
authorDavid Leadbeater <dgl@dgl.cx>2010-12-16 20:14:40 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-12-16 20:41:39 -0800
commit8b079db663fda8b4ad5c7f33655632c57d3e32fd (patch)
treeeaeb49fa965c64d35494d840cf1679c91e58b6d9 /ext/Socket
parent2dcac756b8b2c3b3d7d34174ba27b78fb1c7ba4a (diff)
downloadperl-8b079db663fda8b4ad5c7f33655632c57d3e32fd.tar.gz
[perl #80674] Fix compilation with very old versions of glibc
__priority_which_t does not exist on glibc 2.1. sin6_scope is not present in the set of kernel headers my copy of glibc 2.1 is using. (The presence of sin6_scope in sockaddr_in6 should maybe be a Configure test.) blead now compiles on a positively ancient box -- although the Socket tests fail.
Diffstat (limited to 'ext/Socket')
-rw-r--r--ext/Socket/Socket.xs6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index dcf6715727..c1225ffc1d 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -477,7 +477,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)
sin6.sin6_scope_id = scope_id;
+#endif
ST(0) = newSVpvn_flags((char *)&sin6, sizeof(sin6), SVs_TEMP);
#else
ST(0) = (SV*)not_here("pack_sockaddr_in6");
@@ -505,7 +507,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)
mPUSHi(sin6.sin6_scope_id);
+#else
+ mPUSHi(0);
+#endif
mPUSHi(ntohl(sin6.sin6_flowinfo));
#else
ST(0) = (SV*)not_here("pack_sockaddr_in6");