diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2007-03-05 08:25:32 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2007-03-05 08:25:32 +0000 |
commit | 3315e811a44b0c39e3ffab5f6f6f0de68952f09e (patch) | |
tree | c4fad0e79d6b4031ce3b5f349f966c8d846ccece | |
parent | 5643b1ee8651e14b7f35e960040273c6891b7058 (diff) | |
download | cygnal-3315e811a44b0c39e3ffab5f6f6f0de68952f09e.tar.gz cygnal-3315e811a44b0c39e3ffab5f6f6f0de68952f09e.tar.bz2 cygnal-3315e811a44b0c39e3ffab5f6f6f0de68952f09e.zip |
* include/io.h (__mingw_access): New static inline wrapper to restore
pre-Vista 'access (fname, X_OK)' behaviour.
(__USE_MINGW_ACCESS): Use to map access() to __mingw_access().
-rw-r--r-- | winsup/mingw/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/mingw/include/io.h | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index bd261c7ab..f225db48f 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,5 +1,11 @@ 2007-03-05 Danny Smith <dannysmith@users.sourceforge.net> + * include/io.h (__mingw_access): New static inline wrapper to restore + pre-Vista 'access (fname, X_OK)' behaviour. + (__USE_MINGW_ACCESS): Use to map access() to __mingw_access(). + +2007-03-05 Danny Smith <dannysmith@users.sourceforge.net> + * mingwex/fesetround.c (fesetround): Use unsigned int as operand to stmxcsr. Thanks to Alexey Kuznetsov <ring0_mipt at users dot sf dot net> diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h index 926510236..cfab09880 100644 --- a/winsup/mingw/include/io.h +++ b/winsup/mingw/include/io.h @@ -293,6 +293,15 @@ _CRTIMP int __cdecl unlink (const char*); _CRTIMP int __cdecl write (int, const void*, unsigned int); #endif /* _UWIN */ +#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 + /* Wide character versions. Also declared in wchar.h. */ /* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */ #if 0 |