mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
the days of pre-standard C compilers are gone
This commit is contained in:
parent
4f92a68a81
commit
9bd126a1c4
1 changed files with 0 additions and 10 deletions
|
@ -9,16 +9,6 @@ extern "C" {
|
||||||
|
|
||||||
#include <stddef.h> /* For offsetof */
|
#include <stddef.h> /* For offsetof */
|
||||||
|
|
||||||
/* The offsetof() macro calculates the offset of a structure member
|
|
||||||
in its structure. Unfortunately this cannot be written down
|
|
||||||
portably, hence it is provided by a Standard C header file.
|
|
||||||
For pre-Standard C compilers, here is a version that usually works
|
|
||||||
(but watch out!): */
|
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(type, member) ( (int) & ((type*)0) -> member )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* An array of PyMemberDef structures defines the name, type and offset
|
/* An array of PyMemberDef structures defines the name, type and offset
|
||||||
of selected members of a C structure. These can be read by
|
of selected members of a C structure. These can be read by
|
||||||
PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY
|
PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue