From: Dale Weiler Date: Mon, 11 Feb 2013 17:51:23 +0000 (+0000) Subject: Less duplication X-Git-Tag: before-library~114 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3b630ec5dcd5945e5e0227d6a8e97c86fa2713c5;p=xonotic%2Fgmqcc.git Less duplication --- diff --git a/fs.c b/fs.c index ece62ff..8d73b1d 100644 --- 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) -#elif !defined(__MINGW32__) - #include /* mkdir */ - #include /* 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 - int fs_dir_make(const char *path) { - return mkdir(path); - } +# if !defined(__MINGW32__) +# include /* mkdir */ +# include /* 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__) */