From 4a4cb794d9896ef81316c6b1f560ba9478e31325 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Thu, 7 Nov 2024 09:31:44 +0000 Subject: [PATCH] Fix missing error codes when NO_SOCK and USER_IO are in use Functions in `wolfio.c` unconditionally reference SOCKET_* error codes, even if `errno.h` is conditionally includes in wolfio.h. When compiled with at least WOLFSSL_NO_SOCK + WOLFSSO_USER_IO `wolfio.h` decides not to include `errno.h` and therefore SOCKET_* symbols are missing. Instead of changing "decision tree" in `wolfio.h` and risking breaking it on platforms I couldn't test, use "last resort" include of 'errno.h' in the wolfio.c if configure process detected its presence. --- src/wolfio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wolfio.c b/src/wolfio.c index 158252974f..7376d171c1 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -30,6 +30,10 @@ #include +#ifdef HAVE_ERRNO_H + #include +#endif + #ifndef WOLFCRYPT_ONLY #ifdef _WIN32_WCE