libzip: libzip-discuss: Re: Windows patches

Thread

Thread Index

Message

From: Dieter Baron <dillo%danbala.tuwien.ac.at@localhost>
To: Thomas Klausner <tk%giga.or.at@localhost>
Subject: Re: Windows patches
Date: Wed, 3 Feb 2010 12:10:09 +0100

On Tue, Feb 02, 2010 at 11:42:17PM +0100, Thomas Klausner wrote:
> Hi Patrick!

[...]
> > +#ifdef _MSC_VER
> > +# ifndef mode_t
> > +typedef int mode_t;
> > +# endif
> > +# define strcasecmp _strcmpi        // strcasecmp doesn't exist
> > +# define snprintf _snprintf         // remove linker error
> > +# define strdup _strdup             // deprecated?!? by Microsoft
> > +#endif
> > +
> 
> Brrr. Please check for the functions in cmake instead and make simple
> replacements instead.

  Actually, replacement functions are not necessary if a simple define
does the job.  Please add the correct checks to CMakelist.txt and
configure.ac, and use

#if !defined(HAVE_STRCASECMP) && defined(HAVE__STRCMPI)
#define strcasecmp _strcmpi
#endif

                                                yours,
                                                dillo

Made by MHonArc.