Fix wide-char use in Posix collator

Although the C++ language builds in the 'wchar_t' datatype, the
library functions such as wcscmp() which manipulate them are not
automatically available. For these, inclusion of the <cwhar> header
is still required.

This changeset fixes build breakage observed from failure to include
the requisite system header for accessing wcscmp() and other related
functions on non-GNU standard C++ library implementations.

Change-Id: I5b2f9148ea011004e5dd00cf41698339db172de8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Matt Hoosier 2013-10-15 08:30:16 -05:00 committed by The Qt Project
parent 6c5e6a030d
commit 6e4ea62b0a

View File

@ -44,6 +44,7 @@
#include "qstring.h"
#include <cstring>
#include <cwchar>
QT_BEGIN_NAMESPACE
@ -141,7 +142,7 @@ bool QCollatorSortKey::operator<(const QCollatorSortKey &otherKey) const
int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
{
return wcscmp(d->m_key.constData(),
return std::wcscmp(d->m_key.constData(),
otherKey.d->m_key.constData());
}