Skip to content

Commit af39d30

Browse files
author
martin.v.loewis
committed
Patch #1495999: Part two of Windows CE changes.
- update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c git-svn-id: http://svn.python.org/projects/python/trunk@46819 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 3ca2129 commit af39d30

26 files changed

Lines changed: 201 additions & 33 deletions

Include/Python.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#endif
3636

3737
#include <string.h>
38-
#ifndef DONT_HAVE_ERRNO_H
38+
#ifdef HAVE_ERRNO_H
3939
#include <errno.h>
4040
#endif
4141
#include <stdlib.h>

Include/pyport.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ typedef Py_intptr_t Py_ssize_t;
240240
* to your pyconfig.h. Python code beyond this should check HAVE_STAT and
241241
* HAVE_FSTAT instead.
242242
* Also
243-
* #define DONT_HAVE_SYS_STAT_H
244-
* if <sys/stat.h> doesn't exist on your platform, and
243+
* #define HAVE_SYS_STAT_H
244+
* if <sys/stat.h> exists on your platform, and
245245
* #define HAVE_STAT_H
246-
* if <stat.h> does (don't look at me -- ths mess is inherited).
246+
* if <stat.h> does.
247247
*/
248248
#ifndef DONT_HAVE_STAT
249249
#define HAVE_STAT
@@ -258,7 +258,7 @@ typedef Py_intptr_t Py_ssize_t;
258258
#include "unixstuff.h"
259259
#endif
260260

261-
#ifndef DONT_HAVE_SYS_STAT_H
261+
#ifdef HAVE_SYS_STAT_H
262262
#if defined(PYOS_OS2) && defined(PYCC_GCC)
263263
#include <sys/types.h>
264264
#endif

Modules/_hotshot.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
*/
1515
#ifdef MS_WINDOWS
1616
#include <windows.h>
17+
18+
#ifdef HAVE_DIRECT_H
1719
#include <direct.h> /* for getcwd() */
20+
#endif
21+
1822
typedef __int64 hs_time;
1923
#define GETTIMEOFDAY(P_HS_TIME) \
2024
{ LARGE_INTEGER _temp; \

Modules/_localemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This software comes with no warranty. Use at your own risk.
1616
#include <string.h>
1717
#include <ctype.h>
1818

19-
#ifndef DONT_HAVE_ERRNO_H
19+
#ifdef HAVE_ERRNO_H
2020
#include <errno.h>
2121
#endif
2222

Modules/arraymodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#ifdef STDC_HEADERS
1111
#include <stddef.h>
1212
#else /* !STDC_HEADERS */
13-
#ifndef DONT_HAVE_SYS_TYPES_H
13+
#ifdef HAVE_SYS_TYPES_H
1414
#include <sys/types.h> /* For size_t */
15-
#endif /* DONT_HAVE_SYS_TYPES_H */
15+
#endif /* HAVE_SYS_TYPES_H */
1616
#endif /* !STDC_HEADERS */
1717

1818
struct arrayobject; /* Forward */

Modules/mmapmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ my_getpagesize(void)
5050
#endif /* UNIX */
5151

5252
#include <string.h>
53+
54+
#ifdef HAVE_SYS_TYPES_H
5355
#include <sys/types.h>
56+
#endif /* HAVE_SYS_TYPES_H */
5457

5558
/* Prefer MAP_ANONYMOUS since MAP_ANON is deprecated according to man page. */
5659
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)

Modules/posixmodule.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,21 @@ corresponding Unix manual entries for more information on calls.");
6464
#include "osdefs.h"
6565
#endif
6666

67+
#ifdef HAVE_SYS_TYPES_H
6768
#include <sys/types.h>
69+
#endif /* HAVE_SYS_TYPES_H */
70+
71+
#ifdef HAVE_SYS_STAT_H
6872
#include <sys/stat.h>
73+
#endif /* HAVE_SYS_STAT_H */
6974

7075
#ifdef HAVE_SYS_WAIT_H
7176
#include <sys/wait.h> /* For WNOHANG */
7277
#endif
7378

79+
#ifdef HAVE_SIGNAL_H
7480
#include <signal.h>
81+
#endif
7582

7683
#ifdef HAVE_FCNTL_H
7784
#include <fcntl.h>
@@ -246,9 +253,15 @@ extern int lstat(const char *, struct stat *);
246253
#endif
247254

248255
#ifdef _MSC_VER
256+
#ifdef HAVE_DIRECT_H
249257
#include <direct.h>
258+
#endif
259+
#ifdef HAVE_IO_H
250260
#include <io.h>
261+
#endif
262+
#ifdef HAVE_PROCESS_H
251263
#include <process.h>
264+
#endif
252265
#include "osdefs.h"
253266
#define _WIN32_WINNT 0x0400 /* Needed for CryptoAPI on some systems */
254267
#include <windows.h>

Modules/selectmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
extern void bzero(void *, int);
3737
#endif
3838

39-
#ifndef DONT_HAVE_SYS_TYPES_H
39+
#ifdef HAVE_SYS_TYPES_H
4040
#include <sys/types.h>
4141
#endif
4242

Modules/socketmodule.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ shutdown(how) -- shut down traffic in one or both directions\n\
234234
#endif
235235

236236
/* Generic includes */
237+
#ifdef HAVE_SYS_TYPES_H
237238
#include <sys/types.h>
239+
#endif
238240

239241
/* Generic socket object definitions and includes */
240242
#define PySocket_BUILDING_SOCKET
@@ -270,7 +272,9 @@ int h_errno; /* not used */
270272
#else
271273

272274
/* MS_WINDOWS includes */
273-
# include <fcntl.h>
275+
# ifdef HAVE_FCNTL_H
276+
# include <fcntl.h>
277+
# endif
274278

275279
#endif
276280

@@ -290,7 +294,7 @@ int h_errno; /* not used */
290294
* _SS_ALIGNSIZE is defined in sys/socket.h by 6.5.21,
291295
* for example, but not by 6.5.10.
292296
*/
293-
#elif defined(_MSC_VER) && _MSC_VER>1200
297+
#elif defined(_MSC_VER) && _MSC_VER>1201
294298
/* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
295299
* EAI_* constants are defined in (the already included) ws2tcpip.h.
296300
*/

Modules/timemodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
#include <ctype.h>
2121

22+
#ifdef HAVE_SYS_TYPES_H
2223
#include <sys/types.h>
24+
#endif /* HAVE_SYS_TYPES_H */
2325

2426
#ifdef QUICKWIN
2527
#include <io.h>

0 commit comments

Comments
 (0)