Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
X-Apparently-From: <earnie?boyd@yahoo.com>
Message-ID: <3A59C529.4342E4D4@yahoo.com>
Date: Mon, 08 Jan 2001 08:48:25 -0500
From: Earnie Boyd <earnie_boyd@yahoo.com>
Reply-To: perl5-porters@perl.org, cygwin@sources.redhat.com
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: "Charles S. Wilson" <cwilson@ece.gatech.edu>
CC: Reini Urban <rurban@sbox.tu-graz.ac.at>, perl5-porters@perl.org,
        cygwin@sources.redhat.com
Subject: Re: perl-5.6.1 DB_file support
References: <3A5605B3.AAC25D7F@sbox.tu-graz.ac.at> <3A59255F.85918DE8@sbox.tu-graz.ac.at> <3A5966E5.735999FE@ece.gatech.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

"Charles S. Wilson" wrote:
> 
> Reini Urban wrote:
> > However, something new:
> > A minor required db-3.2.3f patch for cygwin
> >
> > --- db-3.2.3f/os/os_tmpdir.c.orig       Tue Jul  4 21:30:16 2000
> > +++ db-3.2.3f/os/os_tmpdir.c    Sun Jan  7 21:58:30 2001
> > @@ -96,6 +96,9 @@
> >         }
> >  #endif
> >  #ifdef _WIN32
> > +# ifndef _MAX_PATH
> > +#  define _MAX_PATH 260
> > +# endif
> >         /* Get the path to the temporary directory. */
> >         {int len;
> >          char temp[_MAX_PATH + 1];
> 
> 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.

> #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.

> 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.

Cheers,
Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

