From 681f6dc2a30d7d24d7f9c40e5b4a6e2cd5b97c78 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Mon, 12 Nov 2012 18:17:44 +0400 Subject: Move OS-specific defines into appropriate header. Also define os_access() and its mode flags. --- src/common/files.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'src/common/files.c') diff --git a/src/common/files.c b/src/common/files.c index b29b928..7fc142b 100644 --- a/src/common/files.c +++ b/src/common/files.c @@ -26,40 +26,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/client.h" #include "format/pak.h" -#include -#include #include -#ifdef _WIN32 -#include -#include -#else -#include -#endif #if USE_ZLIB #include #endif -#ifdef _WIN32 -#define os_mkdir(p) _mkdir(p) -#define os_unlink(p) _unlink(p) -#define os_stat(p, s) _stat(p, s) -#define os_fstat(f, s) _fstat(f, s) -#define os_fileno(f) _fileno(f) -#define Q_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) -#define Q_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) -typedef struct _stat os_stat_t; -#else -#define os_mkdir(p) mkdir(p, 0775) -#define os_unlink(p) unlink(p) -#define os_stat(p, s) stat(p, s) -#define os_fstat(f, s) fstat(f, s) -#define os_fileno(f) fileno(f) -#define Q_ISREG(m) S_ISREG(m) -#define Q_ISDIR(m) S_ISDIR(m) -typedef struct stat os_stat_t; -#endif - /* ============================================================================= @@ -784,7 +756,7 @@ void FS_FCloseFile(qhandle_t f) static qerror_t get_path_info(const char *path, file_info_t *info) { - os_stat_t st; + Q_STATBUF st; if (os_stat(path, &st) == -1) return Q_Errno(); @@ -806,7 +778,7 @@ static qerror_t get_path_info(const char *path, file_info_t *info) static qerror_t get_fp_info(FILE *fp, file_info_t *info) { - os_stat_t st; + Q_STATBUF st; int fd; fd = os_fileno(fp); -- cgit v1.2.3