summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-06-24 21:28:42 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-06-24 21:28:42 (GMT)
commita45ecae474e1bf7b5e7699c55888d70daa70b85b (patch)
treea386e05200c5c01da86cd91058bc7d5a3dda32a2
parentb9ab15905218c442f92f560307658edf4b70b847 (diff)
downloadcpython-a45ecae474e1bf7b5e7699c55888d70daa70b85b.zip
cpython-a45ecae474e1bf7b5e7699c55888d70daa70b85b.tar.gz
cpython-a45ecae474e1bf7b5e7699c55888d70daa70b85b.tar.bz2
Provide a definition for offsetof.
-rw-r--r--Modules/socketmodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 507e6aa..c4c758c 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -178,6 +178,14 @@ Socket methods:
#include <netpacket/packet.h>
#endif
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#ifndef offsetof
+#define offsetof(type, member) ((size_t)(&((type *)0)->member))
+#endif
+
#ifndef O_NDELAY
#define O_NDELAY O_NONBLOCK /* For QNX only? */
#endif