"Alon Bar-Lev" <alon.bar...@gmail.com> wrote:
Why not: #ifdef WIN32 #define access _access #endif
We should write "#ifndef _MSC_VER". MingW's access() handles X_OK correctly. From MingW's <io.h>:
#ifdef __USE_MINGW_ACCESS /* Old versions of MSVCRT access() just ignored X_OK, while the version shipped with Vista, returns an error code. This will restore the old behaviour */ static inline int __mingw_access (const char* __fname, int __mode) { return _access (__fname, __mode & ~X_OK); } #define access(__f,__m) __mingw_access (__f, __m) #endif --gv