bcrypt: Ensure we have gnutls_hash() available.
Huw Davies
huw at codeweavers.com
Mon Jan 18 05:41:40 CST 2016
Fixes compile failures with older versions of gnutls.
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
configure.ac | 1 +
dlls/bcrypt/bcrypt_main.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0766edf..0eedf43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1270,6 +1270,7 @@ then
#include <gnutls/crypto.h>]], [[static typeof(gnutls_mac_get_key_size) *func; if (func) return 0;]])],
[WINE_CHECK_SONAME(gnutls,gnutls_global_init,,[GNUTLS_CFLAGS=""],[$GNUTLS_LIBS],[[libgnutls\\(-deb0\\)\\{0,1\\}]])])],
[GNUTLS_CFLAGS=""])])
+ WINE_CHECK_LIB_FUNCS(gnutls_hash,[$GNUTLS_LIBS])
fi
WINE_WARNING_WITH(gnutls,[test "x$ac_cv_lib_soname_gnutls" = "x"],
[libgnutls ${notice_platform}development files not found, no schannel support.])
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 227399f..fdd6911 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);
static HINSTANCE instance;
-#if defined(SONAME_LIBGNUTLS) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
+#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
WINE_DECLARE_DEBUG_CHANNEL(winediag);
static void *libgnutls_handle;
@@ -116,7 +116,7 @@ static void gnutls_uninitialize(void)
wine_dlclose( libgnutls_handle, NULL, 0 );
libgnutls_handle = NULL;
}
-#endif /* SONAME_LIBGNUTLS && !HAVE_COMMONCRYPTO_COMMONDIGEST_H */
+#endif /* HAVE_GNUTLS_HASH && !HAVE_COMMONCRYPTO_COMMONDIGEST_H */
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount,
BCRYPT_ALGORITHM_IDENTIFIER **ppAlgList, ULONG dwFlags)
@@ -338,7 +338,7 @@ static NTSTATUS hash_finish( struct hash *hash, UCHAR *output, ULONG size )
}
return STATUS_SUCCESS;
}
-#elif defined(SONAME_LIBGNUTLS)
+#elif defined(HAVE_GNUTLS_HASH)
struct hash
{
struct object hdr;
@@ -642,14 +642,14 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
case DLL_PROCESS_ATTACH:
instance = hinst;
DisableThreadLibraryCalls( hinst );
-#if defined(SONAME_LIBGNUTLS) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
+#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
gnutls_initialize();
#endif
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
-#if defined(SONAME_LIBGNUTLS) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
+#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
gnutls_uninitialize();
#endif
break;
--
1.8.0
More information about the wine-patches
mailing list