Skip to content

Commit 1b43dc1

Browse files
committed
gh-108765: Remove old prototypes from pyport.h
1 parent 7f04dda commit 1b43dc1

File tree

4 files changed

+21
-30
lines changed

4 files changed

+21
-30
lines changed

Include/pyport.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -392,32 +392,6 @@ extern "C" {
392392
# define Py_NO_INLINE
393393
#endif
394394

395-
/**************************************************************************
396-
Prototypes that are missing from the standard include files on some systems
397-
(and possibly only some versions of such systems.)
398-
399-
Please be conservative with adding new ones, document them and enclose them
400-
in platform-specific #ifdefs.
401-
**************************************************************************/
402-
403-
#ifdef SOLARIS
404-
/* Unchecked */
405-
extern int gethostname(char *, int);
406-
#endif
407-
408-
#ifdef HAVE__GETPTY
409-
#include <sys/types.h> /* we need to import mode_t */
410-
extern char * _getpty(int *, int, mode_t, int);
411-
#endif
412-
413-
/* On QNX 6, struct termio must be declared by including sys/termio.h
414-
if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must
415-
be included before termios.h or it will generate an error. */
416-
#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux)
417-
#include <sys/termio.h>
418-
#endif
419-
420-
421395
/* On 4.4BSD-descendants, ctype functions serves the whole range of
422396
* wchar_t character set rather than single byte code points only.
423397
* This characteristic can break some operations of string object

Modules/posixmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
# include <sys/time.h> // futimes()
6262
#endif
6363

64+
// SGI apparently needs this forward declaration
65+
#ifdef HAVE__GETPTY
66+
# include <sys/types.h> // mode_t
67+
extern char * _getpty(int *, int, mode_t, int);
68+
#endif
69+
6470

6571
/*
6672
* A number of APIs are available on macOS from a certain macOS version.

Modules/socketmodule.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,13 @@ Local naming conventions:
111111
#include "pycore_fileutils.h" // _Py_set_inheritable()
112112
#include "pycore_moduleobject.h" // _PyModule_GetState
113113

114+
// gethostname() prototype missing from Solaris standard header files
115+
#ifdef __sun
116+
extern int gethostname(char *, int);
117+
#endif
114118

115119
#ifdef _Py_MEMORY_SANITIZER
116-
# include <sanitizer/msan_interface.h>
120+
# include <sanitizer/msan_interface.h>
117121
#endif
118122

119123
/* Socket object documentation */

Modules/termios.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66

77
#include "Python.h"
88

9-
/* Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE
10-
is defined, so we define it here. */
9+
// On QNX 6, struct termio must be declared by including sys/termio.h
10+
// if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must
11+
// be included before termios.h or it will generate an error.
12+
#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux)
13+
# include <sys/termio.h>
14+
#endif
15+
16+
// Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE
17+
// is defined, so we define it here.
1118
#if defined(__sgi)
12-
#define CTRL(c) ((c)&037)
19+
# define CTRL(c) ((c)&037)
1320
#endif
1421

1522
#if defined(__sun)

0 commit comments

Comments
 (0)