Skip to content

Commit 304f8e1

Browse files
committed
bpo-45898: Remove duplicate symbols from _ctypes/cfield.c
Signed-off-by: Christian Heimes <[email protected]>
1 parent a3fcca4 commit 304f8e1

File tree

2 files changed

+2
-40
lines changed

2 files changed

+2
-40
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:mod:`ctypes` no longer defines ``ffi_type_*`` symbols in ``cfield.c``. The
2+
symbols have been provided by libffi for over a decade.

Modules/_ctypes/cfield.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,44 +1594,4 @@ typedef struct { char c; wchar_t *x; } s_wchar_p;
15941594
#endif
15951595
*/
15961596

1597-
typedef struct { char c; long long x; } s_long_long;
1598-
#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(long long))
1599-
1600-
/* from ffi.h:
1601-
typedef struct _ffi_type
1602-
{
1603-
size_t size;
1604-
unsigned short alignment;
1605-
unsigned short type;
1606-
struct _ffi_type **elements;
1607-
} ffi_type;
1608-
*/
1609-
1610-
/* align and size are bogus for void, but they must not be zero */
1611-
ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID };
1612-
1613-
ffi_type ffi_type_uint8 = { 1, 1, FFI_TYPE_UINT8 };
1614-
ffi_type ffi_type_sint8 = { 1, 1, FFI_TYPE_SINT8 };
1615-
1616-
ffi_type ffi_type_uint16 = { 2, 2, FFI_TYPE_UINT16 };
1617-
ffi_type ffi_type_sint16 = { 2, 2, FFI_TYPE_SINT16 };
1618-
1619-
ffi_type ffi_type_uint32 = { 4, INT_ALIGN, FFI_TYPE_UINT32 };
1620-
ffi_type ffi_type_sint32 = { 4, INT_ALIGN, FFI_TYPE_SINT32 };
1621-
1622-
ffi_type ffi_type_uint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_UINT64 };
1623-
ffi_type ffi_type_sint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_SINT64 };
1624-
1625-
ffi_type ffi_type_float = { sizeof(float), FLOAT_ALIGN, FFI_TYPE_FLOAT };
1626-
ffi_type ffi_type_double = { sizeof(double), DOUBLE_ALIGN, FFI_TYPE_DOUBLE };
1627-
1628-
#ifdef ffi_type_longdouble
1629-
#undef ffi_type_longdouble
1630-
#endif
1631-
/* This is already defined on OSX */
1632-
ffi_type ffi_type_longdouble = { sizeof(long double), LONGDOUBLE_ALIGN,
1633-
FFI_TYPE_LONGDOUBLE };
1634-
1635-
ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER };
1636-
16371597
/*---------------- EOF ----------------*/

0 commit comments

Comments
 (0)