]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix fucking mingw32 shit.
authorDale Weiler <killfieldengine@gmail.com>
Mon, 11 Feb 2013 17:49:17 +0000 (17:49 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 11 Feb 2013 17:49:17 +0000 (17:49 +0000)
fs.c

diff --git a/fs.c b/fs.c
index eb1a57209d97bbd05b4c90bc75338ca2ae670f9f..ece62ff00e959a676e8d298747e6cfdd78053935 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -232,7 +232,7 @@ int fs_file_getline(char **lineptr, size_t *n, FILE *stream) {
  * Now we implement some directory functionality.  Windows lacks dirent.h
  * this is such a pisss off, we implement it here.
  */  
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(__MINGW32__)
     DIR *fs_dir_open(const char *name) {
         DIR *dir = (DIR*)mem_a(sizeof(DIR) + strlen(name));
         if (!dir)
@@ -300,10 +300,14 @@ int fs_file_getline(char **lineptr, size_t *n, FILE *stream) {
      */
 #   undef  S_ISDIR
 #   define S_ISDIR(X) ((X)&_S_IFDIR)
-#else
+#elif !defined(__MINGW32__)
     #include <sys/stat.h> /* mkdir */
     #include <unistd.h>   /* chdir */
 
+    int fs_dir_make(const char *path) {
+        return mkdir(path, 0700);
+    }
+
     DIR *fs_dir_open(const char *name) {
         return opendir(name);
     }
@@ -319,8 +323,27 @@ int fs_file_getline(char **lineptr, size_t *n, FILE *stream) {
     int fs_dir_change(const char *path) {
         return chdir(path);
     }
-
+#else
     int fs_dir_make(const char *path) {
-        return mkdir(path, 0700);
+        return mkdir(path);
+    }
+
+    DIR *fs_dir_open(const char *name) {
+        return opendir(name);
+    }
+
+    int fs_dir_close(DIR *dir) {
+        return closedir(dir);
+    }
+
+    struct dirent *fs_dir_read(DIR *dir) {
+        return readdir(dir);
+    }
+
+    int fs_dir_change(const char *path) {
+        return chdir(path);
     }
-#endif /*! defined (_WIN32) */
+#endif
+
+
+