From b98a0ba804f388f531106ff9602eb22ee66fe751 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 23 Sep 2018 12:08:44 +0800 Subject: [Kernel] Add ARMCC 6.x support. --- include/libc/libc_signal.h | 2 +- include/rtdef.h | 9 +++++++-- include/rtlibc.h | 2 +- include/rtthread.h | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index 5db43eb35e..b592b8227e 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -71,7 +71,7 @@ typedef struct siginfo siginfo_t; #include #endif -#ifdef __CC_ARM +#if defined(__CC_ARM) || defined(__CLANG_ARM) #include typedef unsigned long sigset_t; diff --git a/include/rtdef.h b/include/rtdef.h index 9379a7db44..92b997151d 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -88,14 +88,19 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define RT_UINT32_MAX 0xffffffff /**< Maxium number of UINT32 */ #define RT_TICK_MAX RT_UINT32_MAX /**< Maxium number of tick */ +#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +#define __CLANG_ARM +#endif + /* Compiler Related Definitions */ -#ifdef __CC_ARM /* ARM Compiler */ +#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM Compiler */ #include #define SECTION(x) __attribute__((section(x))) #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) - #define RT_WEAK __weak + + #define RT_WEAK __attribute__((weak)) #define rt_inline static __inline /* module compiling */ #ifdef RT_USING_MODULE diff --git a/include/rtlibc.h b/include/rtlibc.h index 385d57500e..020c34764e 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -25,7 +25,7 @@ #include "libc/libc_signal.h" #include "libc/libc_fdset.h" -#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) typedef signed long off_t; typedef int mode_t; #endif diff --git a/include/rtthread.h b/include/rtthread.h index 82d975d648..f8da2d46bf 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -501,7 +501,7 @@ rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_ubase_t count); rt_int32_t rt_strcmp(const char *cs, const char *ct); rt_size_t rt_strlen(const char *src); char *rt_strdup(const char *s); -#ifdef __CC_ARM +#if defined(__CC_ARM) || defined(__CLANG_ARM) /* leak strdup interface */ char* strdup(const char* str); #endif -- cgit v1.3.1