diff options
Diffstat (limited to 'src/common/utils.c')
-rw-r--r-- | src/common/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/utils.c b/src/common/utils.c index c1128edb4..12123784f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -14,7 +14,11 @@ #include <math.h> // floor() #ifdef WIN32 + #include <io.h> #include <windows.h> + #ifndef F_OK + #define F_OK 0x0 + #endif /* F_OK */ #else #include <unistd.h> #include <dirent.h> @@ -182,6 +186,11 @@ void findfile(const char *p, const char *pat, void (func)(const char*)) } #endif +bool exists(const char* filename) +{ + return !access(filename, F_OK); +} + uint8 GetByte(uint32 val, int idx) { switch( idx ) |