瀏覽代碼

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

Meco Man 4 年之前
父節點
當前提交
b10bef6f24

+ 1 - 3
components/libc/compilers/common/none-gcc/sys/errno.h

@@ -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)

+ 4 - 4
components/net/lwip-1.4.1/src/arch/include/arch/cc.h

@@ -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
-#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__)
-
+#include <sys/errno.h>
 /* 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))

+ 12 - 0
components/net/lwip-2.0.2/src/arch/include/arch/cc.h

@@ -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

+ 3 - 4
components/net/lwip-2.1.2/src/arch/include/arch/cc.h

@@ -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>