[postgis-devel] use of strnicmp

Regina Obe lr at pcorp.us
Fri Sep 22 13:08:33 PDT 2017


FWIW:  All people I know – which is me and OpenSCG that build for windows use Mingw64 chain and that uses autoconf.

 

I suspect PostGIS won't compile under VS or any other standard windows tooling without some serious helping. 

 

Even I think Mat Loskot who tried a while ago and some other guy, were using our CMake build, which is kind of haphazard and not fully functional to build and still required a lot of Unixy tooling to build the sql scripts etc.

 

That said I don't care that much.  I'm pretty happy with Mingw64, it makes building not just PostGIS both other PostgreSQL extensions (e.g. PLV8, ogrfdw, http,  json (ANSI SQL extension thing),  much less painful than trying to do the same in VS.

 

From: postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] On Behalf Of Paul Ramsey
Sent: Friday, September 22, 2017 1:39 PM
To: PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
Subject: Re: [postgis-devel] use of strnicmp

 

There don't actually appear to be any calls to strnicmp in the .c files, so that whole chunk of header seems to be out-of-date. Maybe our windows build base moved in posix support to the point where it doesn't matter anymore. That still leaves questions of why you'd have any regression issues once you got build running though.


P.

 

On Fri, Sep 22, 2017 at 10:04 AM, Greg Troxel <gdt at lexort.com <mailto:gdt at lexort.com> > wrote:


Greg Troxel <gdt at lexort.com <mailto:gdt at lexort.com> > writes:

> Building 2.3.3 on NetBSD, I am running into an error about strnicmp.
> There's a comment in the source about it:
>
>   /* if we are in Unix define stricmp to be strcasecmp and strnicmp to */
>   /* be strncasecmp. I'm not sure if all Unices have these, but Linux */
>   /* does. */
>
> In general, the right approach (in the Unix part of the world) is to
> look at the POSIX standards, and strongly prefer those.  strcasecmp is
> in POSIX, and dates from 4.4BSD, so it's been around a really long time
> (25 years?).  I have no idea about sticmp, but it seems to be an MS
> thing.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html
>
> I haven't figured out why the defines aren't working, but it seems like
> the code should be based on HAVE_FOO, with some way to set those
> semi-manually on Windows (assuming the windows build doesn't use
> autoconf).

The problem is that there are a bunch of ifdefs that define UNIX on a
number of operating systems, and further define LINUX on systems that
aren't Linux, but they don't cover everything.  This seems overly
complicated and wrong; a LINUX ifdef should be used only for things
where the POSIX approach doesn't work and some non-standard Linuxism has
to be used.

As I understand it, there is windows that probably doesn't use autoconf,
and then a wide variety of almost-entirely POSIX systems that do.  So it
seems like the right thing is to get rid of #ifdef UNIX and instead to
use #ifndef WINDOWS, for the right value of windows.

After removing the #ifdef UNIX around the code that defines stricmp to
strcasecmp, raster builds, but some of the tests fail.

I haven't looked at 2.4.0 in this regard yet.  I just noticed a failure
of 2.3.3 as we prepare for the next pkgsrc branch.  It must have worked
when I updated, but perhaps UNIX was defined in the environment for some
reason and now isn't.

_______________________________________________
postgis-devel mailing list
postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/postgis-devel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170922/603a0ab7/attachment.html>


More information about the postgis-devel mailing list