On Mon, 25 Oct 2021, Martin Storsjö wrote:

UCRT's access() function errors out if the X_OK flag is passed.
(The __mingw_access() function was added because the access() function
also used to error out on this flag in msvcrt.dll in Vista, but the
issue there seems to have been reverted at some point, because the
issue can't be reproduced on Vista any longer. But it can be reproduced
with UCRT.)

Change the use of the __USE_MINGW_ACCESS define, to allow defining
__USE_MINGW_ACCESS=0 to use the default version of the function
from the CRT.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
mingw-w64-headers/crt/_mingw.h.in | 13 +++++++++++++
mingw-w64-headers/crt/io.h        |  2 +-
2 files changed, 14 insertions(+), 1 deletion(-)

Unfortunately, this one can't really be used as such - defining access() breaks other projects that use that as an identifier in other places, e.g. like this:

In file included from qt-6.2/src/corelib/kernel/qmetatype.cpp:76: qt-6.2/src/corelib/kernel/qmetaobject.h:72:19: error: too few arguments provided to function-like macro invocation
    Access access() const;
                  ^
llvm-mingw/i686-w64-mingw32/include/io.h:372:9: note: macro 'access' defined here
#define access(__f,__m)  __mingw_access (__f, __m)


So if we want to override/redirect access() on UCRT, we need to replace the access() function altogether in the import library.


// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to