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.
This commit is contained in:
Maxim Ivanov 2024-11-07 09:31:44 +00:00
parent c577ad78df
commit 4a4cb794d9

View File

@ -30,6 +30,10 @@
#include <wolfssl/wolfcrypt/settings.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifndef WOLFCRYPT_ONLY
#ifdef _WIN32_WCE