From eb0f18acbc434d135e6a93c7abd6aea53e6526e8 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 16 Jun 2023 14:12:19 +0200 Subject: [PATCH] Don't use inet_pton() before Windows Vista On runtime it will attempt to get inet_pton() from ws2_32.dll but it's not there and the DLL/program containing mbedtls will not load. Signed-off-by: Steve Lhomme --- library/x509_crt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/x509_crt.c b/library/x509_crt.c index 9b3414a49..453389b7e 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2684,6 +2684,9 @@ find_parent: #elif (defined(__MINGW32__) || defined(__MINGW64__)) && _WIN32_WINNT >= 0x0600 #include #include +#else +/* inet_pton() is not supported, fallback to software version */ +#define MBEDTLS_TEST_SW_INET_PTON #endif #elif defined(__sun) /* Solaris requires -lsocket -lnsl for inet_pton() */