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

Skip to content

Commit bc2e10e

Browse files
committed
Python no longer compiled on Windows, due to #include file confusion
over SEP, ALTSEP and MAXPATHLEN. Patched up posixmodule.c for MSVC, but unsure what the story is now on other non-Unixish platforms -- the preprocessor maze has no exit <wink>.
1 parent 5833baa commit bc2e10e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Modules/posixmodule.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,6 @@ extern int lstat(const char *, struct stat *);
193193
#include <sys/utsname.h>
194194
#endif /* HAVE_SYS_UTSNAME_H */
195195

196-
#ifndef MAXPATHLEN
197-
#define MAXPATHLEN 1024
198-
#endif /* MAXPATHLEN */
199-
200196
#ifdef HAVE_DIRENT_H
201197
#include <dirent.h>
202198
#define NAMLEN(dirent) strlen((dirent)->d_name)
@@ -223,6 +219,7 @@ extern int lstat(const char *, struct stat *);
223219
#include <direct.h>
224220
#include <io.h>
225221
#include <process.h>
222+
#include "osdefs.h"
226223
#define WINDOWS_LEAN_AND_MEAN
227224
#include <windows.h>
228225
#ifdef MS_WIN32
@@ -238,6 +235,10 @@ extern int lstat(const char *, struct stat *);
238235
#include <io.h>
239236
#endif /* OS2 */
240237

238+
#ifndef MAXPATHLEN
239+
#define MAXPATHLEN 1024
240+
#endif /* MAXPATHLEN */
241+
241242
#ifdef UNION_WAIT
242243
/* Emulate some macros on systems that have a union instead of macros */
243244

0 commit comments

Comments
 (0)