Try to fix !defined(LWIP_PROVIDE_ERRNO)

This commit is contained in:
goldsimon 2016-10-07 16:22:33 +02:00
parent 740182de3c
commit 69be49fdc3
3 changed files with 13 additions and 0 deletions

View File

@ -42,6 +42,7 @@
#include "lwip/errno.h"
#if !NO_SYS
/** Table to quickly map an lwIP error (err_t) to a socket error
* by using -err as an index */
static const int err_to_errno_table[] = {
@ -63,6 +64,7 @@ static const int err_to_errno_table[] = {
ENOTCONN, /* ERR_CLSD -15 Connection closed. */
EIO /* ERR_ARG -16 Illegal argument. */
};
#endif /* !NO_SYS */
#ifdef LWIP_DEBUG
@ -103,6 +105,7 @@ lwip_strerr(err_t err)
#endif /* LWIP_DEBUG */
#if !NO_SYS
int
err_to_errno(err_t err)
{
@ -111,3 +114,4 @@ err_to_errno(err_t err)
}
return err_to_errno_table[-err];
}
#endif /* !NO_SYS */

View File

@ -108,7 +108,9 @@ extern const char *lwip_strerr(err_t err);
#define lwip_strerr(x) ""
#endif /* LWIP_DEBUG */
#if !NO_SYS
int err_to_errno(err_t err);
#endif /* !NO_SYS */
#ifdef __cplusplus
}

View File

@ -173,6 +173,13 @@
extern int errno;
#endif
#else /* LWIP_PROVIDE_ERRNO */
/* Define LWIP_ERRNO_INCLUDE to <errno.h> to include the error defines here */
#ifdef LWIP_ERRNO_INCLUDE
#include LWIP_ERRNO_INCLUDE
#endif /* LWIP_ERRNO_INCLUDE */
#endif /* LWIP_PROVIDE_ERRNO */
#ifdef __cplusplus