Pārlūkot izejas kodu

Merge branch 'fix-ctkErrorLogFDMessageHandler-to-support-enable-disable-cycle'

* fix-ctkErrorLogFDMessageHandler-to-support-enable-disable-cycle:
  Fix windows build error using function prefixed with "_"
Jean-Christophe Fillion-Robin 12 gadi atpakaļ
vecāks
revīzija
5fa9b81d59
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 6 5
      Libs/Core/ctkErrorLogFDMessageHandler.cpp

+ 6 - 5
Libs/Core/ctkErrorLogFDMessageHandler.cpp

@@ -113,11 +113,12 @@ void ctkFDHandler::setEnabled(bool value)
   else
     {
     // Print one character to "unblock" the read function associated with the polling thread
-    ssize_t res = write(fileno(this->terminalOutputFile()), "\n", 1);
-    if (res == -1)
-      {
-      return;
-      }
+#ifdef Q_OS_WIN32
+    _write(_fileno(this->terminalOutputFile()), "\n", 1);
+#else
+    write(fileno(this->terminalOutputFile()), "\n", 1);
+#endif
+
     // Flush stdout or stderr so that any buffered messages are delivered
     fflush(this->terminalOutputFile());