[postgis-devel] use of strnicmp

Greg Troxel gdt at lexort.com
Fri Sep 22 09:47:24 PDT 2017


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).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 162 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170922/b0beae5f/attachment.sig>


More information about the postgis-devel mailing list