diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-06-24 21:28:42 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-06-24 21:28:42 (GMT) |
commit | a45ecae474e1bf7b5e7699c55888d70daa70b85b (patch) | |
tree | a386e05200c5c01da86cd91058bc7d5a3dda32a2 | |
parent | b9ab15905218c442f92f560307658edf4b70b847 (diff) | |
download | cpython-a45ecae474e1bf7b5e7699c55888d70daa70b85b.zip cpython-a45ecae474e1bf7b5e7699c55888d70daa70b85b.tar.gz cpython-a45ecae474e1bf7b5e7699c55888d70daa70b85b.tar.bz2 |
Provide a definition for offsetof.
-rw-r--r-- | Modules/socketmodule.c | 8 |
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 |