Ver código fonte

Merge branch 'ctkerrorlogmodel-msvc-compile-error'

* ctkerrorlogmodel-msvc-compile-error:
  Add appropriate header for the std write() function
Julien Finet 13 anos atrás
pai
commit
8f7ad67518
1 arquivos alterados com 5 adições e 0 exclusões
  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
   }
 }