summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2005-09-14 18:15:03 (GMT)
committerGuido van Rossum <guido@python.org>2005-09-14 18:15:03 (GMT)
commite2f5adbc78ade2d280101238a1dc9e7bae2016d6 (patch)
tree6f10854756ebb669f682537c8c7bfb11aa205305 /Modules/socketmodule.h
parente42f446482780553e3e0b3faae1f0300c0a3206d (diff)
downloadcpython-e2f5adbc78ade2d280101238a1dc9e7bae2016d6.zip
cpython-e2f5adbc78ade2d280101238a1dc9e7bae2016d6.tar.gz
cpython-e2f5adbc78ade2d280101238a1dc9e7bae2016d6.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 */