Skip to content

Commit 8d1eb6e

Browse files
author
Liyou Zhou
committed
Fix UINT32_MAX undefined error on armcc targets
C99 explicitly states that these macros should only be defined for C++ implementations if __STDC_LIMIT_MACROS is defined, C++11 subsequently over ruled this and provides the macros without the definition of _STDC_LIMIT_MACROS, hence the only way to use these macros across a range of C++ implementations is to define the macro before including stdint.h.
1 parent c26aec6 commit 8d1eb6e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/mbed_platform.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
#if YOTTA_CFG_MINAR_TEST_CLOCK_OVERFLOW
18+
#define __STDC_LIMIT_MACROS
19+
#include <stdint.h>
20+
#include <stdio.h>
21+
#endif
1722

1823
#include "minar-platform/minar_platform.h"
1924

2025
#include "mbed-hal/lp_ticker_api.h"
2126
#include "mbed-hal/sleep_api.h"
2227
#include "cmsis-core/core_generic.h"
2328

24-
#if YOTTA_CFG_MINAR_TEST_CLOCK_OVERFLOW
25-
#include "stdio.h"
26-
#endif
27-
2829
/// @name Local Constants
2930
const static minar::platform::tick_t Minimum_Sleep = MINAR_PLATFORM_MINIMUM_SLEEP; // in Platform_Time_Base units
3031

0 commit comments

Comments
 (0)