mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Provide local implementation of wcscasecmp() under Windows, where it's non-
existent.
This commit is contained in:
parent
9f41c3304a
commit
13d0637357
|
@ -10,6 +10,27 @@ namespace Details {
|
||||||
using std::wstring;
|
using std::wstring;
|
||||||
using std::list;
|
using std::list;
|
||||||
|
|
||||||
|
#ifdef __WIN32
|
||||||
|
|
||||||
|
// wcscasecmp() function is a GNU extension, we need to reimplement it
|
||||||
|
// for non-GNU systems.
|
||||||
|
|
||||||
|
int wcscasecmp( const wchar_t *s1, const wchar_t *s2 )
|
||||||
|
{
|
||||||
|
for( ; ; ++s1, ++s2 )
|
||||||
|
{
|
||||||
|
if ( towlower( *s1 ) != towlower( *s2 ) )
|
||||||
|
return towlower( *s1 ) > towlower( *s2 ) ? 1 : -1;
|
||||||
|
|
||||||
|
if ( !*s1 )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/////////////// ArticleDom
|
/////////////// ArticleDom
|
||||||
|
|
||||||
wstring ArticleDom::Node::renderAsText() const
|
wstring ArticleDom::Node::renderAsText() const
|
||||||
|
|
Loading…
Reference in a new issue