Skip to content

Commit 3ed697a

Browse files
Merge pull request #4775 from c1728p9/fix_defines
Fix non-portable defines
2 parents b917dba + c18b0e5 commit 3ed697a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

platform/mbed_application.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121

2222
#include<stdint.h>
2323

24-
#define MBED_APPLICATION_SUPPORT defined(__CORTEX_M3) || defined(__CORTEX_M4) || defined(__CORTEX_M7)
24+
#if defined(__CORTEX_M3) || defined(__CORTEX_M4) || defined(__CORTEX_M7)
25+
#define MBED_APPLICATION_SUPPORT 1
26+
#else
27+
#define MBED_APPLICATION_SUPPORT 0
28+
#endif
29+
2530
#if MBED_APPLICATION_SUPPORT
2631
#ifdef __cplusplus
2732
extern "C" {

platform/mbed_critical.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#include "platform/mbed_assert.h"
2424
#include "platform/mbed_toolchain.h"
2525

26-
#define EXCLUSIVE_ACCESS (!defined (__CORTEX_M0) && !defined (__CORTEX_M0PLUS))
26+
#if !defined (__CORTEX_M0) && !defined (__CORTEX_M0PLUS)
27+
#define EXCLUSIVE_ACCESS 1
28+
#else
29+
#define EXCLUSIVE_ACCESS 0
30+
#endif
2731

2832
static volatile uint32_t interrupt_enable_counter = 0;
2933
static volatile bool critical_interrupts_disabled = false;

0 commit comments

Comments
 (0)