浏览代码

Fix windows build error using function prefixed with "_"

Jean-Christophe Fillion-Robin 12 年之前
父节点
当前提交
d937bfa04b
共有 1 个文件被更改,包括 6 次插入5 次删除
  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());