From 6df6decdfcc75f20a0382725de2736c96f8599f9 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Tue, 11 Jun 2019 13:00:12 +0300 Subject: [PATCH] Fix ARMC5 compilation Minor tweaks to fix ARM C 5 compatibility. Pushing "ns_list.h" include to first makes sure "ns_types.h" is included first, meaning it gets to define `__STDC_LIMIT_MACROS` before the first include of , which ensures that UINT8_MAX etc are defined. --- features/netsocket/NetworkInterface.cpp | 2 +- platform/SingletonPtr.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/netsocket/NetworkInterface.cpp b/features/netsocket/NetworkInterface.cpp index e189218a81..48d463b590 100644 --- a/features/netsocket/NetworkInterface.cpp +++ b/features/netsocket/NetworkInterface.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ +#include "ns_list.h" #include "netsocket/NetworkInterface.h" #include "netsocket/NetworkStack.h" #include "platform/Callback.h" #include "platform/mbed_error.h" #include -#include "ns_list.h" // Default network-interface state void NetworkInterface::set_as_default() diff --git a/platform/SingletonPtr.h b/platform/SingletonPtr.h index 9d2cc669ce..2bbb0a89b8 100644 --- a/platform/SingletonPtr.h +++ b/platform/SingletonPtr.h @@ -131,8 +131,8 @@ struct SingletonPtr { // This is zero initialized when in global scope mutable void *_ptr; -#if __cplusplus >= 201103L - // Align data appropriately +#if __cplusplus >= 201103L && !defined __CC_ARM + // Align data appropriately (ARM Compiler 5 does not support alignas in C++11 mode) alignas(T) mutable char _data[sizeof(T)]; #else // Force data to be 8 byte aligned