summaryrefslogtreecommitdiff
path: root/lib/system/keys-win.c
diff options
context:
space:
mode:
authorSteve Lhomme <robux4@ycbcr.xyz>2020-05-27 21:13:43 +0000
committerDmitry Baryshkov <dbaryshkov@gmail.com>2020-05-27 21:13:43 +0000
commite0fa7550c0458a95ea5ca011e1d8c405c18b0f1d (patch)
tree315b6b8d296cd024cc6f6b602ba85d18ca8540da /lib/system/keys-win.c
parent12080aa26a8d963acdfa3aa1b8b444f5f58af6bd (diff)
downloadgnutls-e0fa7550c0458a95ea5ca011e1d8c405c18b0f1d.tar.gz
configure.ac: determine if the Vista APIs can be linked statically
If _WIN32_WINNT is higher or equal to 0x0600, Vista API's are allowed during the build. We can assume that the minimum platform the code will run on is Vista [1] In that case there's no need to call API's (ncrypt) dynamically when it can be done statically. [1] https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
Diffstat (limited to 'lib/system/keys-win.c')
-rw-r--r--lib/system/keys-win.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/system/keys-win.c b/lib/system/keys-win.c
index 678a668e49..767e377040 100644
--- a/lib/system/keys-win.c
+++ b/lib/system/keys-win.c
@@ -26,6 +26,7 @@
#define _WIN32_WINNT 0x600
#endif
+#include <config.h>
#include "gnutls_int.h"
#include "errors.h"
#include <gnutls/gnutls.h>
@@ -45,8 +46,6 @@
#include <winbase.h>
#include <winapifamily.h>
-#define DYN_NCRYPT
-
#ifdef __MINGW32__
# include <_mingw.h>
# ifdef __MINGW64_VERSION_MAJOR
@@ -1487,13 +1486,16 @@ int _gnutls_system_key_init(void)
ret = GNUTLS_E_CRYPTO_INIT_FAILED;
goto fail;
}
-#endif
ncrypt_init = 1;
return 0;
fail:
FreeLibrary(ncrypt_lib);
return ret;
+#else
+ ncrypt_init = 1;
+ return 0;
+#endif
}
void _gnutls_system_key_deinit(void)