]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Less duplication
authorDale Weiler <killfieldengine@gmail.com>
Mon, 11 Feb 2013 17:51:23 +0000 (17:51 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 11 Feb 2013 17:51:23 +0000 (17:51 +0000)
fs.c

diff --git a/fs.c b/fs.c
index ece62ff00e959a676e8d298747e6cfdd78053935..8d73b1d0b8ae793aa8dfefad075c9013457298ec 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -300,50 +300,34 @@ int fs_file_getline(char **lineptr, size_t *n, FILE *stream) {
      */
 #   undef  S_ISDIR
 #   define S_ISDIR(X) ((X)&_S_IFDIR)
      */
 #   undef  S_ISDIR
 #   define S_ISDIR(X) ((X)&_S_IFDIR)
-#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);
-    }
-
-    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);
-    }
 #else
 #else
-    int fs_dir_make(const char *path) {
-        return mkdir(path);
-    }
+#   if !defined(__MINGW32__)
+#       include <sys/stat.h> /* mkdir */
+#       include <unistd.h>   /* chdir */
 
 
-    DIR *fs_dir_open(const char *name) {
-        return opendir(name);
-    }
-
-    int fs_dir_close(DIR *dir) {
-        return closedir(dir);
-    }
+        int fs_dir_make(const char *path) {
+            return mkdir(path, 0700);
+        }
+#   else
+        int fs_dir_make(const char *path) {
+            return mkdir(path);
+        }
+#   endif /*! !defined(__MINGW32__) */
 
 
-    struct dirent *fs_dir_read(DIR *dir) {
-        return readdir(dir);
-    }
+DIR *fs_dir_open(const char *name) {
+    return opendir(name);
+}
 
 
-    int fs_dir_change(const char *path) {
-        return chdir(path);
-    }
-#endif
+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) && !defined(__MINGW32__) */