Browse Source

Merge pull request #4679 from mysterywolf/sys-errno

[bug][libc]修复因libc移除sys/errno.h文件导致的报错
Bernard Xiong 4 years ago
parent
commit
eca044f87c

+ 0 - 7
components/libc/pthreads/posix_types.h

@@ -19,16 +19,9 @@
 
 
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/time.h>
-
-/* errno for Keil MDK */
-#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
-#include <sys/errno.h>
-#include <sys/unistd.h>
-#else
 #include <unistd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <fcntl.h>
-#endif
 
 
 #endif
 #endif
 
 

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

@@ -46,17 +46,16 @@
 #define X32_F "lx"
 #define X32_F "lx"
 
 
 #ifdef RT_USING_LIBC
 #ifdef RT_USING_LIBC
-#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__)
-#include <sys/errno.h>
-#else
 #include <errno.h>
 #include <errno.h>
-/* some errno not defined in newlib */
+#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. */
 #define ESHUTDOWN 180
 #define ESHUTDOWN 180
-#endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */
+#endif
 #endif /* RT_USING_LIBC */
 #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))