Home GnuPG

Don't use F_OK constant which is not defined on Windows

Description

Don't use F_OK constant which is not defined on Windows

The MS documentation for the access() function only list numerical constants.

Details

Provenance
dvratilAuthored on Nov 5 2020, 6:21 PM
Parents
rLIBKLEOdb55799187cd: Use _stricmp instead of strcasecmp when building with MSVC
Branches
Unknown
Tags
Unknown

Event Timeline

For portability reasons it would be better to define F_OK if is is not defined.

#if _WIN32
# ifndef F_OK
#  define F_OK 0
# endif
#endif

Does not work if it is an enum - but that is usually not the case.

In general, I agree. But, given that the whole file is Windows-only and highly Windows-specific (dealing with the Windows registry), does it make sense in this case?

Also, I'm wondering if Daniel sees your comment since the real repo lives on invent.kde.org.