Provide a better way to include system's <errno.h> for errno + error numbers (LWIP_ERRNO_INCLUDE can't be defined to <errno.h> at least on GCC/linux)

This commit is contained in:
sg 2017-02-10 21:18:08 +01:00
parent 239498f37c
commit b9e66bfcfb
2 changed files with 8 additions and 2 deletions

View File

@ -296,7 +296,8 @@ extern "C" {
#endif /* LWIP_UNUSED_ARG */
/** LWIP_PROVIDE_ERRNO==1: Let lwIP provide ERRNO values and the 'errno' variable.
* If this is disabled, cc.h must either define 'errno', include <errno.h> or
* If this is disabled, cc.h must either define 'errno', include <errno.h>,
* define LWIP_ERRNO_STDINCLUDE to get <errno.h> included or
* define LWIP_ERRNO_INCLUDE to <errno.h> or equivalent.
*/
#if defined __DOXYGEN__

View File

@ -179,10 +179,15 @@ extern int errno;
#else /* LWIP_PROVIDE_ERRNO */
/* Define LWIP_ERRNO_INCLUDE to <errno.h> to include the error defines here */
/* Define LWIP_ERRNO_STDINCLUDE if you want to include <errno.h> here */
#ifdef LWIP_ERRNO_STDINCLUDE
#include <errno.h>
#else /* LWIP_ERRNO_STDINCLUDE */
/* Define LWIP_ERRNO_INCLUDE to an equivalent of <errno.h> to include the error defines here */
#ifdef LWIP_ERRNO_INCLUDE
#include LWIP_ERRNO_INCLUDE
#endif /* LWIP_ERRNO_INCLUDE */
#endif /* LWIP_ERRNO_STDINCLUDE */
#endif /* LWIP_PROVIDE_ERRNO */