Remove stricmp macro in favour of NoCaseCompare
This commit is contained in:
parent
5a5297974b
commit
55a5ffdf5c
@ -87,8 +87,6 @@
|
|||||||
#define OBSOLETE __attribute__((deprecated))
|
#define OBSOLETE __attribute__((deprecated))
|
||||||
|
|
||||||
// Some portability macros :)
|
// Some portability macros :)
|
||||||
#define stricmp strcasecmp
|
|
||||||
|
|
||||||
#define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex)))
|
#define FORMATSTRING(formatIndex, va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex)))
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
@ -329,11 +329,9 @@ AString StrToUpper(const AString & s)
|
|||||||
int NoCaseCompare(const AString & s1, const AString & s2)
|
int NoCaseCompare(const AString & s1, const AString & s2)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// MSVC has stricmp that compares case-insensitive:
|
|
||||||
return _stricmp(s1.c_str(), s2.c_str());
|
return _stricmp(s1.c_str(), s2.c_str());
|
||||||
#else
|
#else
|
||||||
// Do it the hard way - convert both strings to lowercase:
|
return strcasecmp(s1.c_str(), s2.c_str());
|
||||||
return StrToLower(s1).compare(StrToLower(s2));
|
|
||||||
#endif // else _MSC_VER
|
#endif // else _MSC_VER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user