Browse Source

Merge branch 'ctkerrorlogmodel-msvc-compile-error'

* ctkerrorlogmodel-msvc-compile-error:
  Add appropriate header for the std write() function
Julien Finet 13 years ago
parent
commit
8f7ad67518
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Libs/Core/ctkErrorLogModel.cpp

+ 5 - 0
Libs/Core/ctkErrorLogModel.cpp

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