If using mingw there is no reason why not use autoconf/automake. If using MSVC you know what you get.
This is how I see it: config-msvc.h #define HAVE_ACCESS 1 #define access _access compat.h #ifndef HAVE_ACCESS int access(...); #endif compat.c #ifndef HAVE_ACCESS int access(...) { } #endif At every file: #ifdef HAVE_CONFIG_H #include <config.h> #elif defined(_MSC_VER) #include <config-msvc.h> #endif On Fri, Dec 2, 2011 at 2:54 PM, Gisle Vanem <gva...@broadpark.no> wrote: > > "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 > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Openvpn-devel mailing list > Openvpn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openvpn-devel