Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ace0505

Browse files
author
Thomas Heller
committed
Remove all the Python 2.3 compatibility markers (the Python 3 ctypes
version is not compatible with Python 2.x anymore). Remove backwards compatibility code.
1 parent 84d66a0 commit ace0505

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

Modules/_ctypes/ctypes.h

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
/*****************************************************************
2-
This file should be kept compatible with Python 2.3, see PEP 291.
3-
*****************************************************************/
4-
5-
#if (PY_VERSION_HEX < 0x02050000)
6-
typedef int Py_ssize_t;
7-
#define PyInt_FromSsize_t PyInt_FromLong
8-
#endif
9-
101
#ifndef MS_WIN32
112
#define max(a, b) ((a) > (b) ? (a) : (b))
123
#define min(a, b) ((a) < (b) ? (a) : (b))
@@ -16,14 +7,6 @@ typedef int Py_ssize_t;
167
#define PARAMFLAG_FLCID 0x4
178
#endif
189

19-
/*
20-
Backwards compatibility:
21-
Python2.2 used LONG_LONG instead of PY_LONG_LONG
22-
*/
23-
#if defined(HAVE_LONG_LONG) && !defined(PY_LONG_LONG)
24-
#define PY_LONG_LONG LONG_LONG
25-
#endif
26-
2710
typedef struct tagPyCArgObject PyCArgObject;
2811
typedef struct tagCDataObject CDataObject;
2912
typedef PyObject *(* GETFUNC)(void *, Py_ssize_t size);
@@ -339,35 +322,6 @@ extern PyObject *PyExc_ArgError;
339322
extern char *conversion_mode_encoding;
340323
extern char *conversion_mode_errors;
341324

342-
/* Python 2.4 macros, which are not available in Python 2.3 */
343-
344-
#ifndef Py_CLEAR
345-
#define Py_CLEAR(op) \
346-
do { \
347-
if (op) { \
348-
PyObject *tmp = (PyObject *)(op); \
349-
(op) = NULL; \
350-
Py_DECREF(tmp); \
351-
} \
352-
} while (0)
353-
#endif
354-
355-
#ifndef Py_VISIT
356-
/* Utility macro to help write tp_traverse functions.
357-
* To use this macro, the tp_traverse function must name its arguments
358-
* "visit" and "arg". This is intended to keep tp_traverse functions
359-
* looking as much alike as possible.
360-
*/
361-
#define Py_VISIT(op) \
362-
do { \
363-
if (op) { \
364-
int vret = visit((op), arg); \
365-
if (vret) \
366-
return vret; \
367-
} \
368-
} while (0)
369-
#endif
370-
371325
#if defined(HAVE_WCHAR_H)
372326
# define CTYPES_UNICODE
373327
#endif

0 commit comments

Comments
 (0)