Browse Source

Fix MinGW build (no sys/dir.h, mkdir only takes 1 argument).
Use _WIN32 instead of __WIN32__.


git-svn-id: file:///var/svn/tigccpp/trunk@1039 9552661e-59e3-4036-b4f2-dbe53926924f

kevinkofler 17 years ago
parent
commit
48e550718d
1 changed files with 9 additions and 5 deletions
  1. 9 5
      ktigcc/tpr.cpp

+ 9 - 5
ktigcc/tpr.cpp

@@ -27,7 +27,9 @@
 #include <cstring>
 #include <unistd.h>
 #include <sys/stat.h>
+#ifndef _WIN32
 #include <sys/dir.h>
+#endif
 #include <QApplication>
 #include <QEventLoop>
 #include <kapplication.h>
@@ -105,7 +107,7 @@ static QString convert_path_separators(const char *file)
     QString s=file;
     int o;
   
-#ifndef __WIN32__
+#ifndef _WIN32
      while ((o=s.find('\\',0,TRUE))>=0)
          s[o]='/';
 #endif
@@ -580,7 +582,7 @@ static QString convert_path_separators_save(QString s)
 {
     int o;
     
-#ifndef __WIN32__
+#ifndef _WIN32
     while ((o=s.find('/',0,TRUE))>=0)
         s[o]='\\';
 #endif
@@ -777,7 +779,7 @@ void mkdir_multi(const char *fileName)
   char buffer[l+2];
   char *ptr;
 
-#ifdef __WIN32__
+#ifdef _WIN32
   ptr=strchr(fileName,'\\');
 #else
   ptr=strchr(fileName,'/');
@@ -787,11 +789,13 @@ void mkdir_multi(const char *fileName)
   {
     memcpy(buffer,fileName,ptr-fileName);
     buffer[ptr-fileName]=0;
-    mkdir(buffer,S_IRWXU | S_IRWXG | S_IRWXO);
+#ifdef _WIN32
+    mkdir(buffer);
     
-#ifdef __WIN32__
     ptr=strchr(ptr+1,'\\');
 #else
+    mkdir(buffer,S_IRWXU | S_IRWXG | S_IRWXO);
+    
     ptr=strchr(ptr+1,'/');
 #endif
   }