Skip to content

Commit 7d98eeb

Browse files
author
Deepika
committed
__IAR_SYSTEMS_ICC__ macro had issues when 7.5 and 8.11 both workbench are installed
1 parent 5875569 commit 7d98eeb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

platform/mbed_retarget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ std::FILE *mbed_fdopen(FileHandle *fh, const char *mode)
843843
}
844844

845845
int mbed_getc(std::FILE *_file){
846-
#if (defined (__ICCARM__) && (__IAR_SYSTEMS_ICC__ < 8) )
846+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000)
847847
/*This is only valid for unbuffered streams*/
848848
int res = std::fgetc(_file);
849849
if (res>=0){
@@ -858,7 +858,7 @@ int mbed_getc(std::FILE *_file){
858858
}
859859

860860
char* mbed_gets(char*s, int size, std::FILE *_file){
861-
#if (defined (__ICCARM__) && (__IAR_SYSTEMS_ICC__ < 8))
861+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000)
862862
/*This is only valid for unbuffered streams*/
863863
char *str = fgets(s,size,_file);
864864
if (str!=NULL){
@@ -884,8 +884,8 @@ extern "C" WEAK void __iar_file_Mtxinit(__iar_Rmtx *mutex) {}
884884
extern "C" WEAK void __iar_file_Mtxdst(__iar_Rmtx *mutex) {}
885885
extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {}
886886
extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {}
887-
#if (__IAR_SYSTEMS_ICC__ >= 8)
888-
extern "C" WEAK void *__aeabi_read_tp (void) {}
887+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
888+
extern "C" WEAK void *__aeabi_read_tp (void) { return NULL ;}
889889
#endif
890890
#elif defined(__CC_ARM)
891891
// Do nothing

rtos/TARGET_CORTEX/mbed_boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
#include "cmsis_os2.h"
169169
#include "mbed_toolchain.h"
170170
#include "mbed_error.h"
171-
#if (defined(__ICCARM__) && (__IAR_SYSTEMS_ICC__ >= 8) )
171+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
172172
#include <DLib_Threads.h>
173173
#endif
174174
/* Heap limits - only used if set */
@@ -576,7 +576,7 @@ void pre_main(void)
576576
singleton_mutex_attr.cb_mem = &singleton_mutex_obj;
577577
singleton_mutex_id = osMutexNew(&singleton_mutex_attr);
578578

579-
#if (__IAR_SYSTEMS_ICC__ >= 8)
579+
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000)
580580
__iar_Initlocks();
581581
#endif
582582

0 commit comments

Comments
 (0)