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


Earnie Boyd wrote:
> 
> "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.
> 
-8<-
> 
> 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'll correct myself here.  The change needs to be made to limits.h.  In
limits.h we find that we have PATH_MAX defined.  We should also include
MAX_PATH and _MAX_PATH just for the sake of porting idiosyncrasy.

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


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