From 4bd5154c9f8aee90a219e32f04d4c48b9639ddc9 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sun, 23 Aug 2015 02:21:53 +0200 Subject: [PATCH] stdclass: Use access to check if file is readable --- core/stdclass.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/stdclass.cpp b/core/stdclass.cpp index 75b9dcb40..fed5b18b2 100644 --- a/core/stdclass.cpp +++ b/core/stdclass.cpp @@ -1,12 +1,17 @@ - #include #include #include - #include "types.h" +#if BUILD_COMPILER==COMPILER_VC + #include + #define access _access + #define R_OK 4 +#else + #include +#endif + #include "hw/mem/_vmem.h" -#include "types.h" string user_config_dir; string user_data_dir; @@ -15,8 +20,7 @@ std::vector system_data_dirs; bool file_exists(const string& filename) { - struct stat info; - return (stat (filename.c_str(), &info) == 0); + return (access(filename.c_str(), R_OK) == 0); } void set_user_config_dir(const string& dir)