Skip to content

Commit b26fc41

Browse files
methaneemmatyping
andauthored
Remove obsolete and unused configure macros (#159513)
Co-authored-by: Emma Smith <emma@emmatyping.dev>
1 parent 7159b15 commit b26fc41

18 files changed

Lines changed: 29 additions & 815 deletions

‎Include/internal/pycore_fileutils.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ extern void _Py_skiproot(const wchar_t *path, Py_ssize_t size, Py_ssize_t *drvsi
281281
// _Py_BEGIN_SUPPRESS_IPH
282282
// ...
283283
// _Py_END_SUPPRESS_IPH
284-
#if defined _MSC_VER && _MSC_VER >= 1900
284+
#if defined _MSC_VER
285285

286286
# include <stdlib.h> // _set_thread_local_invalid_parameter_handler()
287287

@@ -294,7 +294,7 @@ extern void _Py_skiproot(const wchar_t *path, Py_ssize_t size, Py_ssize_t *drvsi
294294
#else
295295
# define _Py_BEGIN_SUPPRESS_IPH
296296
# define _Py_END_SUPPRESS_IPH
297-
#endif /* _MSC_VER >= 1900 */
297+
#endif /* _MSC_VER */
298298

299299
// Export for 'select' shared extension (Argument Clinic code)
300300
PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *);

‎Include/pymacconfig.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#undef DOUBLE_IS_BIG_ENDIAN_IEEE754
2222
#undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
2323
#undef HAVE_GCC_ASM_FOR_X87
24-
#undef HAVE_GCC_ASM_FOR_X64
2524

2625
#undef VA_LIST_IS_ARRAY
2726
#if defined(__LP64__) && defined(__x86_64__)
@@ -79,7 +78,6 @@
7978
#if defined(__i386__) || defined(__x86_64__)
8079
# define HAVE_GCC_ASM_FOR_X87
8180
# define ALIGNOF_MAX_ALIGN_T 16
82-
# define HAVE_GCC_ASM_FOR_X64 1
8381
# define SIZEOF_LONG_DOUBLE 16
8482
#else
8583
# define ALIGNOF_MAX_ALIGN_T 8

‎Include/pyport.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,6 @@ extern "C" {
637637
# endif
638638
#endif
639639

640-
#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
641-
# define _SGI_MP_SOURCE
642-
#endif
643-
644640
// Explicit fallthrough in switch case to avoid warnings
645641
// with compiler flag -Wimplicit-fallthrough.
646642
//

‎Modules/_cursesmodule.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static const char PyCursesVersion[] = "2.2";
107107
#define CURSES_MODULE
108108
#include "py_curses.h"
109109

110-
#if defined(HAVE_TERM_H) || defined(__sgi)
110+
#ifdef HAVE_TERM_H
111111
/* For termname, longname, putp, tigetflag, tigetnum, tigetstr, tparm
112112
which are not declared in SysV curses and for setupterm. */
113113
#include <term.h>
@@ -120,7 +120,7 @@ static const char PyCursesVersion[] = "2.2";
120120
#include <langinfo.h>
121121
#endif
122122

123-
#if !defined(NCURSES_VERSION) && (defined(sgi) || defined(__sun) || defined(SCO5))
123+
#if !defined(NCURSES_VERSION) && (defined(__sun) || defined(SCO5))
124124
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
125125
typedef chtype attr_t; /* No attr_t type is available */
126126
#endif

‎Modules/posixmodule.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,6 @@
311311
#endif
312312

313313

314-
#if !defined(_MSC_VER) && defined(__sgi) && _COMPILER_VERSION>=700
315-
/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode
316-
(default) */
317-
extern char *ctermid_r(char *);
318-
#endif
319-
320-
321314
#if defined(__VXWORKS__)
322315
# include <vxCpuLib.h>
323316
# include <rtpLib.h>

‎Modules/selectmodule.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@
5454
#include <sys/poll.h>
5555
#endif
5656

57-
#ifdef __sgi
58-
/* This is missing from unistd.h */
59-
extern void bzero(void *, int);
60-
#endif
61-
6257
#ifdef HAVE_SYS_TYPES_H
6358
#include <sys/types.h>
6459
#endif

‎Modules/socketmodule.c‎

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
190190
#ifdef HAVE_GETHOSTBYNAME_R
191191
# if defined(_AIX) && !defined(_LINUX_SOURCE_COMPAT)
192192
# define HAVE_GETHOSTBYNAME_R_3_ARG
193-
# elif defined(__sun) || defined(__sgi)
193+
# elif defined(__sun)
194194
# define HAVE_GETHOSTBYNAME_R_5_ARG
195195
# elif defined(__linux__)
196196
/* Rely on the configure script */
@@ -216,29 +216,6 @@ shutdown(how) -- shut down traffic in one or both directions\n\
216216
# include <netbt/sco.h>
217217
#endif
218218

219-
#if defined(__sgi) && _COMPILER_VERSION>700 && !_SGIAPI
220-
/* make sure that the reentrant (gethostbyaddr_r etc)
221-
functions are declared correctly if compiling with
222-
MIPSPro 7.x in ANSI C mode (default) */
223-
224-
/* XXX Using _SGIAPI is the wrong thing,
225-
but I don't know what the right thing is. */
226-
#undef _SGIAPI /* to avoid warning */
227-
#define _SGIAPI 1
228-
229-
#undef _XOPEN_SOURCE
230-
#include <sys/socket.h>
231-
#include <sys/types.h>
232-
#include <netinet/in.h>
233-
#ifdef _SS_ALIGNSIZE
234-
#define HAVE_GETADDRINFO 1
235-
#define HAVE_GETNAMEINFO 1
236-
#endif
237-
238-
#define HAVE_INET_PTON
239-
#include <netdb.h>
240-
#endif // __sgi
241-
242219
/* Solaris fails to define this variable at all. */
243220
#if (defined(__sun) && defined(__SVR4)) && !defined(INET_ADDRSTRLEN)
244221
#define INET_ADDRSTRLEN 16
@@ -418,16 +395,10 @@ remove_unusable_flags(PyObject *m)
418395
#endif
419396

420397
/* include Python's addrinfo.h unless it causes trouble */
421-
#if defined(__sgi) && _COMPILER_VERSION>700 && defined(_SS_ALIGNSIZE)
422-
/* Do not include addinfo.h on some newer IRIX versions.
423-
* _SS_ALIGNSIZE is defined in sys/socket.h by 6.5.21,
424-
* for example, but not by 6.5.10.
425-
*/
426-
#elif defined(_MSC_VER) && _MSC_VER>1201
427-
/* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
428-
* EAI_* constants are defined in (the already included) ws2tcpip.h.
429-
*/
430-
#else
398+
/* Do not include addrinfo.h for MSVC. 'addrinfo' and
399+
* EAI_* constants are defined in (the already included) ws2tcpip.h.
400+
*/
401+
#if !defined(_MSC_VER)
431402
# include "addrinfo.h"
432403
#endif
433404

‎Modules/termios.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@
2121
# include <sys/termio.h>
2222
#endif
2323

24-
// Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE
25-
// is defined, so we define it here.
26-
#if defined(__sgi)
27-
# define CTRL(c) ((c)&037)
28-
#endif
29-
3024
// We could do better. Check bpo-32660
3125
#if defined(__sun)
3226
# include <sys/filio.h>

‎Modules/timemodule.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,14 +854,14 @@ time_strftime1(time_char **outbuf, size_t *bufsize,
854854
return NULL;
855855
}
856856
*outbuf = tmp;
857-
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
857+
#if defined _MSC_VER && defined(__STDC_SECURE_LIB__)
858858
errno = 0;
859859
#endif
860860
_Py_BEGIN_SUPPRESS_IPH
861861
buflen = format_time(*outbuf, *bufsize, format, tm);
862862
_Py_END_SUPPRESS_IPH
863-
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
864-
/* VisualStudio .NET 2005 does this properly */
863+
#if defined _MSC_VER && defined(__STDC_SECURE_LIB__)
864+
/* The secure CRT reports invalid format strings with EINVAL. */
865865
if (buflen == 0 && errno == EINVAL) {
866866
PyErr_SetString(PyExc_ValueError, "Invalid format string");
867867
return NULL;

‎PC/invalid_parameter_handler.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
#include <stdlib.h>
44

5-
#if _MSC_VER >= 1900
6-
/* pyconfig.h uses this function in the _Py_BEGIN/END_SUPPRESS_IPH
7-
* macros. It does not need to be defined when building using MSVC
8-
* earlier than 14.0 (_MSC_VER == 1900).
5+
/* pycore_fileutils.h uses this function in the _Py_BEGIN/END_SUPPRESS_IPH
6+
* macros.
97
*/
108

119
static void __cdecl _silent_invalid_parameter_handler(
@@ -18,5 +16,3 @@ static void __cdecl _silent_invalid_parameter_handler(
1816
_invalid_parameter_handler _Py_silent_invalid_parameter_handler = _silent_invalid_parameter_handler;
1917

2018
#endif
21-
22-
#endif

0 commit comments

Comments
 (0)