[GRASS-dev] G_strcasecmp() in GRASS 7

Hi,

do we need our own G_strcasecmp()? Bearing in mind that libc offers
strcasecmp() and strncasecmp().

Thanks for clarification.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Martin Landa wrote:

do we need our own G_strcasecmp()? Bearing in mind that libc offers
strcasecmp() and strncasecmp().

Windows doesn't have these (it has stricmp and/or strcmpi instead).
Also, strcasecmp() is affected by the locale (LC_CTYPE), while
G_strcasecmp() isn't.

--
Glynn Clements <glynn@gclements.plus.com>

Hi,

2011/7/23 Glynn Clements <glynn@gclements.plus.com>:

do we need our own G_strcasecmp()? Bearing in mind that libc offers
strcasecmp() and strncasecmp().

Windows doesn't have these (it has stricmp and/or strcmpi instead).

recently I have used strncasecmp() in db/ogr/execute.c and it's
compile on Windows without any problem.

Also, strcasecmp() is affected by the locale (LC_CTYPE), while
G_strcasecmp() isn't.

OK, in this case I would suggest to implement G_strncasecmp().

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Martin Landa wrote:

>> do we need our own G_strcasecmp()? Bearing in mind that libc offers
>> strcasecmp() and strncasecmp().
>
> Windows doesn't have these (it has stricmp and/or strcmpi instead).

recently I have used strncasecmp() in db/ogr/execute.c and it's
compile on Windows without any problem.

MinGW defines it in libmoldname<version>.a, which is linked by
default. It wouldn't work if you built with MSVC, although the same is
true for the POSIX functions (these functions have leading underscores
in MSVCRT; libmoldnames exists mainly to define aliases without the
underscores).

--
Glynn Clements <glynn@gclements.plus.com>