瀏覽代碼

Merge branch 'ctkerrorlogmodel-msvc-compile-error'

* ctkerrorlogmodel-msvc-compile-error:
  Add appropriate header for the std write() function
Julien Finet 13 年之前
父節點
當前提交
8f7ad67518
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Libs/Core/ctkErrorLogModel.cpp

+ 5 - 0
Libs/Core/ctkErrorLogModel.cpp

@@ -37,6 +37,7 @@
 
 // STD includes
 #include <cstdio> // For _fileno or fileno
+#include <io.h>
 
 // --------------------------------------------------------------------------
 // ctkErrorLogLevel methods
@@ -155,7 +156,11 @@ void ctkErrorLogTerminalOutput::output(const QString& text)
   {
     QMutexLocker locker(&d->OutputMutex);
     QString textWithNewLine = text + "\n";
+#ifdef _MSC_VER
+    _write(d->FD, qPrintable(textWithNewLine), textWithNewLine.size());
+#else
     write(d->FD, qPrintable(textWithNewLine), textWithNewLine.size());
+#endif
   }
 }