[PATCH] w32: Fix use of GetProcAddress.

NIIBE Yutaka via Gcrypt-devel <[email protected]> Fri, 12 Dec 2025 11:56:59 +0900
Newsgroups gmane.comp.encryption.gpg.libgcrypt.devel
Message-ID <028926d3edb52ac2ea6bfabf92748c323265a1d7.1765508194.git.gniibe@fsij.org>
* src/hwfeatures.c (_gcry_get_sysconfdir): Add a type cast.

--

GnuPG-bug-id: 7968
Signed-off-by: NIIBE Yutaka <[email protected]>
---
 src/hwfeatures.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

_______________________________________________
Gcrypt-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
0001-w32-Fix-use-of-GetProcAddress.patch (text/x-patch, 566 B)
diff --git a/src/hwfeatures.c b/src/hwfeatures.c
index 94070b0c..1b107e63 100644
--- a/src/hwfeatures.c
+++ b/src/hwfeatures.c
@@ -328,7 +328,7 @@ _gcry_get_sysconfdir (void)
       if (handle)
         {
           buf = xmalloc (MAX_PATH+17+1); /* Space for "/GNU/etc/gcrypt/" */
-          func = GetProcAddress (handle, "SHGetFolderPathA");
+          func = (void *)GetProcAddress (handle, "SHGetFolderPathA");
           if (func && func (NULL, CSIDL_COMMON_APPDATA, NULL, 0, buf) >= 0)
             {
               appdata = xmalloc (strlen (buf) + 17 + 1);