common: Allow building with released libgpg-error.

* common/sysutils.c (gnupg_access) [W32]: Fix for older libgpgrt.
--

Fixes-commit: c94ee1386e
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-10-23 20:14:45 +02:00
parent 2d4de4b6f0
commit 32f336d955
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
3 changed files with 12 additions and 8 deletions

View File

@ -1105,22 +1105,24 @@ gnupg_getcwd (void)
gpg_err_code_t gpg_err_code_t
gnupg_access (const char *name, int mode) gnupg_access (const char *name, int mode)
{ {
#if GPGRT_VERSION_NUMBER < 0x012800 /* 1.39 */ #if GPGRT_VERSION_NUMBER < 0x012800 /* 1.40 */
# ifdef HAVE_W32_SYSTEM # ifdef HAVE_W32_SYSTEM
wchar_t *wfname; wchar_t *wname;
gpg_err_code_t ec;
wfname = utf8_to_wchar (fname); wname = utf8_to_wchar (name);
if (!wfname) if (!wname)
ec = gpg_err_code_from_syserror (); ec = gpg_err_code_from_syserror ();
else else
{ {
ec = _waccess (wfname, mode)? gpg_err_code_from_syserror () : 0; ec = _waccess (wname, mode)? gpg_err_code_from_syserror () : 0;
xfree (wfname); xfree (wname);
} }
return ec;
# else # else
return access (name, mode)? gpg_err_code_from_syserror () : 0; return access (name, mode)? gpg_err_code_from_syserror () : 0;
# endif # endif
#else #else /* gpgrt 1.40 or newer. */
return gpgrt_access (name, mode); return gpgrt_access (name, mode);
#endif #endif
} }

View File

@ -227,7 +227,8 @@ Note that such a comment will be removed if the git commit option
- Some-comments-by :: Name or mail address of the author of - Some-comments-by :: Name or mail address of the author of
additional comments (commit log or code). additional comments (commit log or code).
- Proofread-by :: Sometimes used by translation commits. - Proofread-by :: Sometimes used by translation commits.
- Signed-off-by :: Name or mail address of the developer - Signed-off-by :: Name or mail address of the developer.
- Backported-from-master :: Value is the commit id of the original patch.
* Windows * Windows
** How to build an installer for Windows ** How to build an installer for Windows

View File

@ -77,6 +77,7 @@ enum {
#define SCM_SCR331 0xe001 #define SCM_SCR331 0xe001
#define SCM_SCR331DI 0x5111 #define SCM_SCR331DI 0x5111
#define SCM_SCR335 0x5115 #define SCM_SCR335 0x5115
#define SCM_SCR3310 0x5116 /* @MAXX Basic */
#define SCM_SCR3320 0x5117 #define SCM_SCR3320 0x5117
#define SCM_SPR532 0xe003 /* Also used succeeding model SPR332. */ #define SCM_SPR532 0xe003 /* Also used succeeding model SPR332. */
#define CHERRY_ST2000 0x003e #define CHERRY_ST2000 0x003e