Skip to content

Commit c62f654

Browse files
authored
Merge pull request #8843 from miyuki/fix-cxx11
Fix C++11 build with Arm Compiler 6
2 parents acbde4e + 5c351dc commit c62f654

File tree

2 files changed

+13
-1
lines changed
  • components/802.15.4_RF/stm-s2lp-rf-driver/source
  • features/frameworks/nanostack-libservice/mbed-client-libservice

2 files changed

+13
-1
lines changed

components/802.15.4_RF/stm-s2lp-rf-driver/source/s2lpReg.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ typedef enum {
301301
S2LP_STATE_SYNTH_SETUP = 0x50
302302
} s2lp_states_e;
303303

304+
#if defined __cplusplus && __cplusplus >= 201103
305+
typedef enum : uint8_t {
306+
#else
304307
typedef enum {
308+
#endif
305309
S2LP_CMD_TX = 0x60,
306310
S2LP_CMD_RX,
307311
S2LP_CMD_READY,

features/frameworks/nanostack-libservice/mbed-client-libservice/ns_types.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ typedef int_fast32_t int_fast24_t;
121121
#define alignas(n) __align(n)
122122
#define __alignas_is_defined 1
123123
#elif (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L) || (defined __cplusplus && __cplusplus >= 201103L)
124-
#include <stdalign.h>
124+
# if defined __ARMCC_VERSION && __ARMCC_VERSION < 6120000
125+
/* Workaround for Arm Compiler versions prior to 6.12 */
126+
# if !defined __cplusplus
127+
# define alignas _Alignas
128+
# endif
129+
# define __alignas_is_defined 1
130+
# else
131+
# include <stdalign.h>
132+
# endif
125133
#elif defined __GNUC__
126134
#define alignas(n) __attribute__((__aligned__(n)))
127135
#define __alignas_is_defined 1

0 commit comments

Comments
 (0)