]> granicus.if.org Git - python/commitdiff
All modern compilers provide a offsetof() function
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 3 Jun 2014 16:45:05 +0000 (18:45 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 3 Jun 2014 16:45:05 +0000 (18:45 +0200)
offsetof() is used directly in many other .c files without any issue.

Modules/socketmodule.c

index 5a2893ce4d2d33c1488dbe4a9fcb60457ba463d4..1facc49cb0a32f156d6eec21bf66cbd10d455451 100644 (file)
@@ -288,10 +288,6 @@ if_indextoname(index) -- return the corresponding interface name\n\
 
 #include <stddef.h>
 
-#ifndef offsetof
-# define offsetof(type, member) ((size_t)(&((type *)0)->member))
-#endif
-
 #ifndef O_NONBLOCK
 # define O_NONBLOCK O_NDELAY
 #endif