]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Provide a definition for offsetof.
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 24 Jun 2001 21:28:42 +0000 (21:28 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 24 Jun 2001 21:28:42 +0000 (21:28 +0000)
Modules/socketmodule.c

index 507e6aa5c1c098fffcd802951c6e3ad155515695..c4c758cc79cce0fe76d269c5834c9ea60eab9591 100644 (file)
@@ -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