MIME-version: 1.0 Message-id: <08FAFA87DB33410B973A78243D6791E6@...139...> From: Gisle Vanem References: <1322828243-21196-1-git-send-email-davids@...1347...> Date: Fri, 02 Dec 2011 13:54:39 +0100 Subject: Re: [Openvpn-devel] [PATCH v2] Provide an access() wrapper for Windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-type: text/plain; CHARSET=US-ASCII; charset="US-ASCII"; format=flowed; reply-type=original Content-Transfer-Encoding: 7bit To: openvpn-devel@lists.sourceforge.net "Alon Bar-Lev" 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 : #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