This commit is contained in:
mysterywolf 2020-10-02 12:00:52 +08:00
parent aeff91b2a7
commit c7aa6f0619
8 changed files with 39 additions and 15 deletions

View File

@ -1 +1,10 @@
This folder is "common" for armlibc newlibc and dlib. It's not "common" for minilibc.
# Attention :
1. This folder is "common" for armlibc newlibc and dlib. It's not "common" for minilibc.
2. If you want to add new .c files, please do not forget to fix SConscript file too. eg:
```python
if GetDepend('RT_USING_POSIX') == False:
SrcRemove(src, ['unistd.c'])
```

View File

@ -66,7 +66,7 @@ typedef uintptr_t mem_ptr_t;
#endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */
#endif
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC) || defined(RT_LIBC_USING_TIME) || defined ( __GNUC__)
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/time.h>
#define LWIP_TIMEVAL_PRIVATE 0
#else
@ -78,10 +78,15 @@ typedef uintptr_t mem_ptr_t;
#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END
#elif defined(__IAR_SYSTEMS_ICC__) /* IAR Compiler */
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /*Arm Compiler 6*/
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_STRUCT __attribute__((packed))
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#elif defined(__IAR_SYSTEMS_ICC__) /* IAR Compiler */
#define PACK_STRUCT_BEGIN #pragma pack(1)
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END #pragma pack()
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_USE_INCLUDES
#elif defined(__GNUC__) /* GNU GCC Compiler */

View File

@ -45,7 +45,7 @@
#define S32_F "ld"
#define X32_F "lx"
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC) || defined(RT_LIBC_USING_TIME) || defined ( __GNUC__)
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/time.h>
#define LWIP_TIMEVAL_PRIVATE 0
#else
@ -57,10 +57,15 @@
#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END
#elif defined(__IAR_SYSTEMS_ICC__) /* IAR Compiler */
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /*Arm Compiler 6*/
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_STRUCT __attribute__((packed))
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#elif defined(__IAR_SYSTEMS_ICC__) /* IAR Compiler */
#define PACK_STRUCT_BEGIN #pragma pack(1)
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END #pragma pack()
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_USE_INCLUDES
#elif defined(__GNUC__) /* GNU GCC Compiler */

View File

@ -59,7 +59,7 @@
#endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */
#endif /* RT_USING_LIBC */
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC) || defined(RT_LIBC_USING_TIME) || defined ( __GNUC__)
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/time.h>
#define LWIP_TIMEVAL_PRIVATE 0
#else
@ -71,10 +71,15 @@
#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END
#elif defined(__IAR_SYSTEMS_ICC__) /* IAR Compiler */
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /*Arm Compiler 6*/
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_STRUCT __attribute__((packed))
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#elif defined(__IAR_SYSTEMS_ICC__) /* IAR Compiler */
#define PACK_STRUCT_BEGIN #pragma pack(1)
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END #pragma pack()
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_USE_INCLUDES
#elif defined(__GNUC__) /* GNU GCC Compiler */

View File

@ -13,7 +13,7 @@
#include <rtconfig.h>
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
/* use errno.h file in toolchains */
#include <errno.h>
#endif
@ -45,7 +45,7 @@ defined in armcc/errno.h
#define ERROR_BASE_NO 0
#endif
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) && !defined(__GNUC__ )
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) && !(defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#define EPERM (ERROR_BASE_NO + 1)
#define ENOENT (ERROR_BASE_NO + 2)

View File

@ -12,7 +12,7 @@
#ifndef LIBC_FCNTL_H__
#define LIBC_FCNTL_H__
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <fcntl.h>
#ifndef O_NONBLOCK

View File

@ -13,7 +13,7 @@
#include <rtconfig.h>
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/types.h>
#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>

View File

@ -9,7 +9,7 @@
#include <rtconfig.h>
#if defined(RT_USING_NEWLIB) || defined( __GNUC__ )
#if defined(RT_USING_NEWLIB) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
/* use header file of newlib */
#include <sys/stat.h>