Something has changed in Cygwin, and it no longer has a definition for "stricmp". I changed the sole occurence to strcasecmp, which is used elsewhere in mplayer. This is strange code, and I did not attempt to understand why it was doing such a test for NULL.
Stephen Sheldon wrote:
Something has changed in Cygwin, and it no longer has a definition for "stricmp". I changed the sole occurence to strcasecmp, which is used elsewhere in mplayer. This is strange code, and I did not attempt to understand why it was doing such a test for NULL.
Potmeter definitions in the skin file specify 2 images, 'buttonbitmaps' and 'phasebitmaps', where one of them may be "NULL", i.e. no related image to display at all. Or, case independent, "Null" or "null". Hence, this test. Hans-Dieter
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".
We have to find out when (and why) the change has happened in order to support both Cygwin version. As soon as I'll spare time. Ingo
Le quintidi 25 nivôse, an CCXXIII, Ingo Brückl a écrit :
We have to find out when (and why) the change has happened in order to support both Cygwin version. As soon as I'll spare time.
Is is really necessary? It looks like stricmp() is a perfect synonym for strcasecmp() (probably NIH syndrome), so if strcasecmp() works, it can be used both for older and newer versions. (And if strcasecmp() is an issue, there is always av_strcasecmp().) Regards, -- Nicolas George
Nicolas George wrote on Wed, 14 Jan 2015 10:00:26 +0100:
It looks like stricmp() is a perfect synonym for strcasecmp() (probably NIH syndrome), so if strcasecmp() works, it can be used both for older and newer versions.
I suppose there is a reason for stricmp() (AFAIR, Windows doesn't have strcasecmp()). If Cygwin had strcasecmp() before - fine, but I don't know and have to check. Ingo
Le quintidi 25 nivôse, an CCXXIII, Ingo Brückl a écrit :
I suppose there is a reason for stricmp() (AFAIR, Windows doesn't have
I am convinced stricmp() exists because microsoft thought strcasecmp() was Not Invented Here, and it was probably used in MPlayer because the patch that introduced it was made by a developer more familiar with microsoft's idiosyncrasies.
strcasecmp()). If Cygwin had strcasecmp() before - fine, but I don't know and have to check.
The OP said that strcasecmp() is used all over the place, and grep confirms, so obviously strcasecmp() is not a problem. And as I said, if strcasecmp() were a problem, there is a reliable reimplementation in libavutil. Regards, -- Nicolas George
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".
Fixed. Ingo
On 14 January 2015 19:04:15 CET, "Ingo Brückl" <ib@wupperonline.de> wrote:
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".
Fixed.
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...
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. Ingo
On 01/15/2015 09:40 AM, Ingo Brückl wrote:
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. Apparently Microsoft has "deprecated" stricmp. If you search it you find people reporting that it no longer works for them.
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).
Reimar Döffinger wrote on Sun, 18 Jan 2015 19:03:03 +0100:
On Thu, Jan 15, 2015 at 06:40:37PM +0100, Ingo Brückl wrote:
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.
In the meantime, me neither. My consideration turned out to be irrelevant. Ingo
On Sunday 18 January 2015 19:03:03, Reimar Döffinger wrote :
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).
Back at the time I programmed with Borland Turbo C, stricmp was the only supported variant. Likewise, National Instrument Labwindows/CVI only supports stricmp. You need not to care about those two compilers. The former doesn't exist any more and the latter is largely too crappy to compile anything but code designed for it. Nobody sound of mind would port mplayer to either compiler :-) I think stricmp was introduced by Borland for its Turbo C compiler (maybe strcasecmp didn't exist at the time or the name was judged too long). As that compiler was the reference around 1990, Microsoft used the same API for its C compiler. Others followed in suit except in the Unix world where strcasecmp was the only supported function. In any case, don't use the non-ANSI stricmp function. If you ever encounter a compiler that only support stricmp, use a code like this: #if defined(_CVI_) #define strcasecmp stricmp #define strncasecmp strnicmp #endif Frederic
participants (6)
-
Frédéric Marchal -
Hans-Dieter Kosch -
Ingo Brückl -
Nicolas George -
Reimar Döffinger -
Stephen Sheldon