This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: perl-5.6.1 DB_file support


On Mon, Jan 08, 2001 at 08:48:25AM -0500, Earnie Boyd wrote:
>> AARRGHH.  No no no.  Cygwin is not WIN32.  While some packages, when
>> ported to cygwin, do rely on code within #ifdef _WIN32 blocks, this is a
>> mistake.  If you want to use code for WIN32 and for cygwin, then do:
>
>Well, I'm perplexed that it MAX_PATH and _MAX_PATH isn't set in the
>Cygwin headers already somewhere.  I find MAX_PATH in mingw/stdlib.h and
>w32api/windef.h.  I find _MAX_PATH defined in mingw/stdlib.h as the
>value of MAX_PATH.

I don't know for sure but I think that MAX_PATH is a Windows thing.
UNIX programs should probably use PATH_MAX.  PATH_MAX is mentioned
frequently at the Single UNIX Specification site.  MAX_PATH is not
mentioned at all.

>> #if defined(_WIN32) || defined(__CYGWIN__)
>> 
>> To accommodate *bad* ports, cygwin's gcc used to define _WIN32, but that
>> behavior will be dropped soon IIRC.
>
>Where did you get that piece of information or are you dreaming? 
>Although I would wholeheartedly support such a move, I don't think that
>the Cygwin's commercial client list would be that happy about such a
>move.

Actually, since we are now distributing the net release of gcc rather
than some internal Red Hat release, we can make any changes that we
want.  The Red Hat releases can still use whatever makes sense.

I have been reluctant to make the is change because I thought that it
could potentially unleash a torrent of complaints here, actually.

>> Also, IMO, burying a constant
>> definition like that in the middle of a .c is just poor programming.
>> Put it in a header file somewhere, at the very least.  Best, find out
>> where the appropriate cygwin MAXPATH constant is defined in cygwin's
>> system headers and #include the appropriate .h.
>> 
>
>I agree.  But, a caution here is in order, don't include the
>mingw/stdlib.h for a Cygwin program, they are only for use by the
>-mno-cygwin switch.  IMO, we need to add MAX_PATH and _MAX_PATH to
>stdlib.h of Cygwin which requires a Newlib patch.

I don't think that we need this for UNIX ported programs.  It is not
standard.  I can't find it on any of the UNIX systems that I have access
to.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]