diff --git a/include/rtdef.h b/include/rtdef.h index 8307ff666cd574a420ee99879260a738278bf357..442f9ecd5db9f2f221bf0908de82dd77d38c152b 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -22,8 +22,8 @@ extern "C" { #endif /* RT-Thread version information */ -#define RT_VERSION 3 -#define RT_SUBVERSION 0 +#define RT_VERSION 4L +#define RT_SUBVERSION 0L /* date type defination */ typedef signed char rt_int8_t; @@ -56,12 +56,19 @@ typedef rt_uint32_t rt_off_t; /* Type for offset. */ #define RT_UINT16_MAX 0xffff /* Maxium number of UINT16. */ #define RT_UINT32_MAX 0xffffffff /* Maxium number of UINT32. */ +/* Compiler Related Definitions */ #ifdef __CC_ARM /* ARM Compiler */ #include #define SECTION(x) __attribute__((section(x))) #define UNUSED __attribute__((unused)) #define ALIGN(n) __attribute__((aligned(n))) #define rt_inline static __inline + /* module compiling */ + #ifdef RT_USING_MODULE + #define RTT_API __declspec(dllimport) + #else + #define RTT_API __declspec(dllexport) + #endif #elif defined (__ICCARM__) /* for IAR Compiler */ #include @@ -69,6 +76,7 @@ typedef rt_uint32_t rt_off_t; /* Type for offset. */ #define UNUSED #define ALIGN(n) #pragma pack(n) #define rt_inline inline + #define RTT_API #elif defined (__GNUC__) /* GNU GCC Compiler */ #ifdef RT_USING_NEWLIB @@ -91,11 +99,15 @@ typedef rt_uint32_t rt_off_t; /* Type for offset. */ #define UNUSED __attribute__((unused)) #define ALIGN(n) __attribute__((aligned(n))) #define rt_inline static __inline + #define RTT_API + #elif defined (__ICCM16C__) /* for IAR EW M16C Compiler */ #include #define SECTION(x) @ x #define UNUSED #define rt_inline inline + #define RTT_API + #endif /* event length */ diff --git a/include/rtthread.h b/include/rtthread.h index b3d6621e221c9df8ec1bf894b4218c60a2fb4fc4..152b9556e633936439d46423a96ad04a68c94954 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -27,16 +27,6 @@ extern "C" { #endif -#if defined(__CC_ARM) -#ifdef RT_USING_MODULE -#define RTT_API __declspec(dllimport) -#else -#define RTT_API __declspec(dllexport) -#endif -#elif defined(__GNUC__) -#define RTT_API -#endif - /** * @addtogroup KernelObject */ diff --git a/src/kservice.c b/src/kservice.c index e1aa3ffb514ac61df6b1ad54f062d58f542f6e7e..0d0190c4e2ffa41c4d5e61cbdd7c4d5f8c7a0933 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -922,13 +922,13 @@ rt_device_t rt_console_set_device(const char* name) #if defined(__GNUC__) void rt_hw_console_output(const char* str) __attribute__((weak)); - - void rt_hw_console_output(const char* str) #elif defined(__CC_ARM) __weak void rt_hw_console_output(const char* str) #elif defined(__ICCARM__) __weak void rt_hw_console_output(const char* str) +#elif defined(__ICCM16C__) +__weak void rt_hw_console_output(const char* str) #endif { /* empty console output */