classification
Title: Building on CygWin 1.7: PATH_MAX redefined
Type: compile error Stage:
Components: Installation, Windows Versions: Python 3.1
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Scott.Rostrup, jbinder, terry.reedy
Priority: normal Keywords:

Created on 2010-04-27 16:43 by jbinder, last changed 2010-12-24 04:05 by Scott.Rostrup.

Files
File name Uploaded Description Edit
python-build-logs.tar.gz jbinder, 2010-04-27 16:43 Logs of ./configure and make output
py_cygwin_build-3.1.3.txt Scott.Rostrup, 2010-12-24 04:05 Log of make error
Messages (3)
msg104334 - (view) Author: Jeff Binder (jbinder) Date: 2010-04-27 16:43
Building Python 3.1.2 on Cygwin 1.7, I got errors in main.c stemming from a warning: PATH_MAX redefined (see attached log).  I got around this by commenting out the #define.  I don't know if the best solution is #ifndef, #undef, or something else. . . . I know CygWin has changed the value of PATH_MAX in 1.7 (see: http://www.cygwin.com/cygwin-ug-net/ov-new1.7.html), though I'm not sure why that would cause this problem.
msg113037 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-05 20:01
None of the developers are much up on Cygwin and I am not sure it is directly supported by the core distribution. If it is not, this should be closed unless you have a specific patch.

In any case, you might do better with your question on python-list. Also, PEP11 list Jason Tishler (jason@tishler.net) as Cygwin maintainer.

Next time, please attach an edited, plain-text .txt log that can be viewed in the browser. I would have to be really motivated to download and extract a tar.gz file.
msg124589 - (view) Author: Scott Rostrup (Scott.Rostrup) Date: 2010-12-24 04:05
I just encountered this error in python 3.1.3 on cygwin 1.7.
I used the same fix as jbinder.

Old Modules/main.c (line 13):

  #if defined(MS_WINDOWS) || defined(__CYGWIN__)
  #include <windows.h>
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #define PATH_MAX MAXPATHLEN
  #endif
  #endif

I guess now cygwin is defining PATH_MAX, one possible fix with ifndef:

  #if defined(MS_WINDOWS) || defined(__CYGWIN__)
  #include <windows.h>
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #ifndef
  #define PATH_MAX MAXPATHLEN
  #endif
  #endif
  #endif

This compiled and worked for me and it appears jbinder as well.
History
Date User Action Args
2010-12-24 04:05:38Scott.Rostrupsetfiles: + py_cygwin_build-3.1.3.txt
nosy: + Scott.Rostrup
messages: + msg124589

2010-08-10 11:37:32floxsetcomponents: + Windows
2010-08-05 20:01:56terry.reedysetnosy: + terry.reedy
messages: + msg113037
2010-04-27 16:43:09jbindercreate