From 65fd106dae4027e8b1fedfd55160d9c6d23e0f6f Mon Sep 17 00:00:00 2001
From: Michel Rasquin <michel.rasquin@cenaero.be>
Date: Fri, 18 Sep 2015 14:49:26 +0000
Subject: [PATCH] Fix compatibility issue between Linux and Windows

---
 Post/adaptiveData.cpp |  6 +++++-
 Post/adaptiveData.h   | 11 +++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Post/adaptiveData.cpp b/Post/adaptiveData.cpp
index 23b687e8cf..64c58bbef0 100644
--- a/Post/adaptiveData.cpp
+++ b/Post/adaptiveData.cpp
@@ -1836,7 +1836,11 @@ void VTKData::initVTKFile()
       vtkDirName = vtkFileName;
     }
 
-    mkdir(vtkDirName.c_str(),S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); //755
+#if defined(WIN32)
+    mkdir(vtkDirName.c_str());
+#else
+    mkdir(vtkDirName.c_str(),S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); //755
+#endif
 
     vtkFileName = vtkDirName + ".p" + vtkFormat; // add pvtu extension to file name
     vtkFile = fopen(vtkFileName.c_str(),"w");
diff --git a/Post/adaptiveData.h b/Post/adaptiveData.h
index 53bb6c52f2..8bac610f45 100644
--- a/Post/adaptiveData.h
+++ b/Post/adaptiveData.h
@@ -19,9 +19,16 @@
 #include <sstream>
 #include "fullMatrix.h"
 
+#if defined(WIN32)
+  typedef unsigned __int8 uint8_t; // Valid for _MSC_VER >= 1300
+  typedef unsigned __int64 uint64_t
+  #define PRIu8 "u"
+  #define PRIu64 "I64u"
+#else
+  #define __STDC_FORMAT_MACROS
+  #include <inttypes.h>
+#endif
 
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
 typedef std::vector<int> vectInt;
 
 class PViewData;
-- 
GitLab