From 7d98eebf2a4e34bc7cdc26f733998015dc3160b9 Mon Sep 17 00:00:00 2001 From: Deepika Date: Tue, 22 Aug 2017 17:17:07 -0500 Subject: [PATCH] __IAR_SYSTEMS_ICC__ macro had issues when 7.5 and 8.11 both workbench are installed --- platform/mbed_retarget.cpp | 8 ++++---- rtos/TARGET_CORTEX/mbed_boot.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index dba17896b0..a48c1c9696 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -843,7 +843,7 @@ std::FILE *mbed_fdopen(FileHandle *fh, const char *mode) } int mbed_getc(std::FILE *_file){ -#if (defined (__ICCARM__) && (__IAR_SYSTEMS_ICC__ < 8) ) +#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000) /*This is only valid for unbuffered streams*/ int res = std::fgetc(_file); if (res>=0){ @@ -858,7 +858,7 @@ int mbed_getc(std::FILE *_file){ } char* mbed_gets(char*s, int size, std::FILE *_file){ -#if (defined (__ICCARM__) && (__IAR_SYSTEMS_ICC__ < 8)) +#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000) /*This is only valid for unbuffered streams*/ char *str = fgets(s,size,_file); if (str!=NULL){ @@ -884,8 +884,8 @@ extern "C" WEAK void __iar_file_Mtxinit(__iar_Rmtx *mutex) {} extern "C" WEAK void __iar_file_Mtxdst(__iar_Rmtx *mutex) {} extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {} extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {} -#if (__IAR_SYSTEMS_ICC__ >= 8) -extern "C" WEAK void *__aeabi_read_tp (void) {} +#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000) +extern "C" WEAK void *__aeabi_read_tp (void) { return NULL ;} #endif #elif defined(__CC_ARM) // Do nothing diff --git a/rtos/TARGET_CORTEX/mbed_boot.c b/rtos/TARGET_CORTEX/mbed_boot.c index c2d1042278..c71f46c00f 100644 --- a/rtos/TARGET_CORTEX/mbed_boot.c +++ b/rtos/TARGET_CORTEX/mbed_boot.c @@ -168,7 +168,7 @@ #include "cmsis_os2.h" #include "mbed_toolchain.h" #include "mbed_error.h" -#if (defined(__ICCARM__) && (__IAR_SYSTEMS_ICC__ >= 8) ) +#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000) #include #endif /* Heap limits - only used if set */ @@ -576,7 +576,7 @@ void pre_main(void) singleton_mutex_attr.cb_mem = &singleton_mutex_obj; singleton_mutex_id = osMutexNew(&singleton_mutex_attr); -#if (__IAR_SYSTEMS_ICC__ >= 8) +#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000) __iar_Initlocks(); #endif