tools/linguist/shared/translator.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
child 33 3e2da88830cd
--- a/tools/linguist/shared/translator.cpp	Wed Jun 23 19:07:03 2010 +0300
+++ b/tools/linguist/shared/translator.cpp	Tue Jul 06 15:10:48 2010 +0300
@@ -45,8 +45,13 @@
 
 #include <stdio.h>
 #ifdef Q_OS_WIN
-#include <io.h> // required for _setmode, to avoid _O_TEXT streams...
-#include <fcntl.h> // for _O_BINARY
+// required for _setmode, to avoid _O_TEXT streams...
+# ifdef Q_OS_WINCE
+#  include <stdlib.h>
+# else
+#  include <io.h> // for _setmode
+#  include <fcntl.h> // for _O_BINARY
+# endif
 #endif
 
 #include <QtCore/QDebug>
@@ -213,7 +218,11 @@
     if (filename.isEmpty() || filename == QLatin1String("-")) {
 #ifdef Q_OS_WIN
         // QFile is broken for text files
+# ifdef Q_OS_WINCE
+        ::_setmode(stdin, _O_BINARY);
+# else
         ::_setmode(0, _O_BINARY);
+# endif
 #endif
         if (!file.open(stdin, QIODevice::ReadOnly)) {
             cd.appendError(QString::fromLatin1("Cannot open stdin!? (%1)")
@@ -253,7 +262,11 @@
     if (filename.isEmpty() || filename == QLatin1String("-")) {
 #ifdef Q_OS_WIN
         // QFile is broken for text files
+# ifdef Q_OS_WINCE
+        ::_setmode(stdout, _O_BINARY);
+# else
         ::_setmode(1, _O_BINARY);
+# endif
 #endif
         if (!file.open(stdout, QIODevice::WriteOnly)) {
             cd.appendError(QString::fromLatin1("Cannot open stdout!? (%1)")
@@ -652,7 +665,7 @@
     int numPlurals = 1;
     if (l != QLocale::C) {
         QStringList forms;
-        if (getNumerusInfo(l, c, 0, &forms))
+        if (getNumerusInfo(l, c, 0, &forms, 0))
             numPlurals = forms.count(); // includes singular
     }
     for (int i = 0; i < m_messages.count(); ++i) {