[MPlayer-dev-eng] [patch] stricmp

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 18 19:03:03 CET 2015

On Thu, Jan 15, 2015 at 06:40:37PM +0100, Ingo Brückl wrote:
> Reimar Döffinger wrote on Wed, 14 Jan 2015 21:19:44 +0100:
> >>Stephen Sheldon wrote on Tue, 13 Jan 2015 10:45:38 -0800:
> >>
> >> Something has changed in Cygwin, and it no longer has a definition
> >> for "stricmp".
> > To be honest I agree with Nicolas here: I see no reason to use stricmp
> > even the whole rest of the code base uses strcasecmp for the same
> > effect, especially not if it involves ugly ifdefs...
> I had in mind people maybe using a more Windows-like compiler that would only
> have stricmp (which is the Windows standard, AFAIK) but seemingly we are only
> supporting Cygwin, MinGW and Wine, so this consideration seems irrelevant.

I don't see the connection either way.
All other code uses strcasecmp, what is the point if you can compile
the GUI code with such a compiler but none of all the other code?
The only question I see is what is better code:
1) Code with several hundred uses of strcasecmp and one stricmp
2) Code which only uses strcasecmp
3) Code which only uses stricmp

And I think 2 is the only sensible choice (besides using av_strcasecmp
which might have other advantages), supporting compilers without
it is still possible without issue by e.g. using a macro or helper
in osdep/ that implements strcasecmp via stricmp.
Btw. anyone else find the name choice "stricmp" funny?
I just thought it ironic that they chose the only ascii letter "i"
that is going to cause issues when people use it (
stricmp/strcasecmp("i", "I") says they do not match for Turkish locales
in case you didn't know).

More information about the MPlayer-dev-eng mailing list