summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2005-09-14 18:09:42 (GMT)
committerGuido van Rossum <guido@python.org>2005-09-14 18:09:42 (GMT)
commit8ee3e5aa9306a00573817e237bed4a482473e818 (patch)
tree6d5dc937d3b495c5295fe6c5c4b3e212ab5509c0 /Modules/socketmodule.h
parent539c662f10b41d15f658cabfa03cc02902862adc (diff)
downloadcpython-8ee3e5aa9306a00573817e237bed4a482473e818.zip
cpython-8ee3e5aa9306a00573817e237bed4a482473e818.tar.gz
cpython-8ee3e5aa9306a00573817e237bed4a482473e818.tar.bz2
- Changes donated by Elemental Security to make it work on AIX 5.3
with IBM's 64-bit compiler (SF patch #1284289). This also closes SF bug #105470: test_pwd fails on 64bit system (Opteron).
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r--Modules/socketmodule.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 601c282..384d595 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -72,6 +72,26 @@ typedef int SOCKET_T;
# define SIZEOF_SOCKET_T SIZEOF_INT
#endif
+/* Socket address */
+typedef union sock_addr {
+ struct sockaddr_in in;
+#ifdef AF_UNIX
+ struct sockaddr_un un;
+#endif
+#ifdef ENABLE_IPV6
+ struct sockaddr_in6 in6;
+ struct sockaddr_storage storage;
+#endif
+#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
+ struct sockaddr_l2 bt_l2;
+ struct sockaddr_rc bt_rc;
+ struct sockaddr_sco bt_sco;
+#endif
+#ifdef HAVE_NETPACKET_PACKET_H
+ struct sockaddr_ll ll;
+#endif
+} sock_addr_t;
+
/* The object holding a socket. It holds some extra information,
like the address family, which is used to decode socket address
arguments properly. */
@@ -82,24 +102,7 @@ typedef struct {
int sock_family; /* Address family, e.g., AF_INET */
int sock_type; /* Socket type, e.g., SOCK_STREAM */
int sock_proto; /* Protocol type, usually 0 */
- union sock_addr {
- struct sockaddr_in in;
-#ifdef AF_UNIX
- struct sockaddr_un un;
-#endif
-#ifdef ENABLE_IPV6
- struct sockaddr_in6 in6;
- struct sockaddr_storage storage;
-#endif
-#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
- struct sockaddr_l2 bt_l2;
- struct sockaddr_rc bt_rc;
- struct sockaddr_sco bt_sco;
-#endif
-#ifdef HAVE_NETPACKET_PACKET_H
- struct sockaddr_ll ll;
-#endif
- } sock_addr;
+ sock_addr_t sock_addr; /* Socket address */
PyObject *(*errorhandler)(void); /* Error handler; checks
errno, returns NULL and
sets a Python exception */