[sys/errno.h] 修复lwip报错

This commit is contained in:
Meco Man 2021-05-22 03:20:01 +08:00
parent 0e0e2a0f95
commit b10bef6f24
4 changed files with 20 additions and 11 deletions

View File

@ -37,10 +37,8 @@ defined in armcc/errno.h
#define ERROR_BASE_NO 0 #define ERROR_BASE_NO 0
#endif #endif
#if !defined(_WIN32) #if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
#include <errno.h> #include <errno.h>
#define EPERM (ERROR_BASE_NO + 1) #define EPERM (ERROR_BASE_NO + 1)
#define ENOENT (ERROR_BASE_NO + 2) #define ENOENT (ERROR_BASE_NO + 2)
#define ESRCH (ERROR_BASE_NO + 3) #define ESRCH (ERROR_BASE_NO + 3)

View File

@ -54,16 +54,16 @@ typedef uintptr_t mem_ptr_t;
#define S32_F "ld" #define S32_F "ld"
#define X32_F "lx" #define X32_F "lx"
#ifdef RT_USING_LIBC #include <sys/errno.h>
#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__)
/* some errno not defined in newlib */ /* some errno not defined in newlib */
#ifndef ENSRNOTFOUND
#define ENSRNOTFOUND 163 /* Domain name not found */ #define ENSRNOTFOUND 163 /* Domain name not found */
/* WARNING: ESHUTDOWN also not defined in newlib. We chose /* WARNING: ESHUTDOWN also not defined in newlib. We chose
180 here because the number "108" which is used 180 here because the number "108" which is used
in arch.h has been assigned to another error code. */ in arch.h has been assigned to another error code. */
#endif
#ifndef ESHUTDOWN
#define ESHUTDOWN 180 #define ESHUTDOWN 180
#endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */
#endif #endif
#if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))

View File

@ -45,6 +45,18 @@
#define S32_F "ld" #define S32_F "ld"
#define X32_F "lx" #define X32_F "lx"
#include <sys/errno.h>
/* some errno not defined in newlib */
#ifndef ENSRNOTFOUND
#define ENSRNOTFOUND 163 /* Domain name not found */
/* WARNING: ESHUTDOWN also not defined in newlib. We chose
180 here because the number "108" which is used
in arch.h has been assigned to another error code. */
#endif
#ifndef ESHUTDOWN
#define ESHUTDOWN 180
#endif
#if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/time.h> #include <sys/time.h>
#define LWIP_TIMEVAL_PRIVATE 0 #define LWIP_TIMEVAL_PRIVATE 0

View File

@ -45,18 +45,17 @@
#define S32_F "ld" #define S32_F "ld"
#define X32_F "lx" #define X32_F "lx"
#ifdef RT_USING_LIBC
#include <sys/errno.h> #include <sys/errno.h>
/* some errno not defined in newlib */
#ifndef ENSRNOTFOUND #ifndef ENSRNOTFOUND
#define ENSRNOTFOUND 163 /* Domain name not found */ #define ENSRNOTFOUND 163 /* Domain name not found */
#endif
#ifndef ESHUTDOWN
/* WARNING: ESHUTDOWN also not defined in newlib. We chose /* WARNING: ESHUTDOWN also not defined in newlib. We chose
180 here because the number "108" which is used 180 here because the number "108" which is used
in arch.h has been assigned to another error code. */ in arch.h has been assigned to another error code. */
#endif
#ifndef ESHUTDOWN
#define ESHUTDOWN 180 #define ESHUTDOWN 180
#endif #endif
#endif /* RT_USING_LIBC */
#if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/time.h> #include <sys/time.h>