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

Skip to content

Commit cdc4451

Browse files
committed
Include <unistd.h> in Python.h. Fixes #500924.
1 parent edb60a7 commit cdc4451

30 files changed

Lines changed: 4 additions & 109 deletions

Include/Python.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
#ifdef HAVE_STDLIB_H
5050
#include <stdlib.h>
5151
#endif
52+
#ifdef HAVE_UNISTD_H
53+
#include <unistd.h>
54+
#endif
5255

5356
/* CAUTION: Build setups should ensure that NDEBUG is defined on the
5457
* compiler command line when building Python in release mode; else

Modules/_hotshot.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#include "frameobject.h"
99
#include "structmember.h"
1010

11-
#ifdef HAVE_UNISTD_H
12-
#include <unistd.h>
13-
#endif
14-
1511
/*
1612
* Which timer to use should be made more configurable, but that should not
1713
* be difficult. This will do for now.

Modules/bsddbmodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
#include "pythread.h"
1919
#endif
2020

21-
#ifdef HAVE_UNISTD_H
22-
#include <unistd.h>
23-
#endif
24-
2521
#include <sys/types.h>
2622
#include <sys/stat.h>
2723
#include <fcntl.h>

Modules/fcntlmodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
#include "Python.h"
55

6-
#ifdef HAVE_UNISTD_H
7-
#include <unistd.h>
8-
#endif
9-
106
#ifdef HAVE_SYS_FILE_H
117
#include <sys/file.h>
128
#endif

Modules/getpath.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#include <sys/types.h>
77
#include <string.h>
88

9-
#if HAVE_UNISTD_H
10-
#include <unistd.h>
11-
#endif /* HAVE_UNISTD_H */
12-
139
#ifdef WITH_NEXT_FRAMEWORK
1410
#include <mach-o/dyld.h>
1511
#endif

Modules/linuxaudiodev.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
#include "Python.h"
1717
#include "structmember.h"
1818

19-
#ifdef HAVE_UNISTD_H
20-
#include <unistd.h>
21-
#endif
22-
2319
#ifdef HAVE_FCNTL_H
2420
#include <fcntl.h>
2521
#else

Modules/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#include "osdefs.h"
55
#include "compile.h" /* For CO_FUTURE_DIVISION */
66

7-
#ifdef HAVE_UNISTD_H
8-
#include <unistd.h>
9-
#endif
10-
117
#ifdef MS_WINDOWS
128
#include <fcntl.h>
139
#endif

Modules/mmapmodule.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ my_getpagesize(void)
3636
#endif
3737

3838
#ifdef UNIX
39-
#include <unistd.h>
4039
#include <sys/mman.h>
4140
#include <sys/stat.h>
4241

Modules/posixmodule.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ corresponding Unix manual entries for more information on calls.";
4646
#include <grp.h>
4747
#endif
4848

49-
/* pick up declaration of confstr on some systems? */
50-
#ifdef HAVE_UNISTD_H
51-
#include <unistd.h>
52-
#endif /* HAVE_UNISTD_H */
53-
5449
/* Various compilers have only certain posix functions */
5550
/* XXX Gosh I wish these were all moved into pyconfig.h */
5651
#if defined(PYCC_VACPP) && defined(PYOS_OS2)
@@ -112,10 +107,6 @@ corresponding Unix manual entries for more information on calls.";
112107

113108
#ifndef _MSC_VER
114109

115-
#ifdef HAVE_UNISTD_H
116-
#include <unistd.h>
117-
#endif
118-
119110
#if defined(sun) && !defined(__SVR4)
120111
/* SunOS 4.1.4 doesn't have prototypes for these: */
121112
extern int rename(const char *, const char *);

Modules/readline.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
#include <signal.h>
1313
#include <errno.h>
1414

15-
#ifdef HAVE_UNISTD_H
16-
#include <unistd.h> /* For isatty() */
17-
#endif
18-
1915
/* GNU readline definitions */
2016
#undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */
2117
#include <readline/readline.h>

0 commit comments

Comments
 (0)