Move __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS before #include <stdint.h>. (#601)

Macros must be defined before first include of stdint.h. Else they have no effect.
This commit is contained in:
David Hebbeker 2022-09-14 12:12:47 +02:00 committed by GitHub
parent 796752172c
commit d31f787585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,20 @@ SOFTWARE.
#ifndef ETL_PLATFORM_INCLUDED
#define ETL_PLATFORM_INCLUDED
//*************************************
// Enable all limit macros
// Note: This macro must be defined before the first include of stdint.h
#if !defined(__STDC_LIMIT_MACROS)
#define __STDC_LIMIT_MACROS
#endif
//*************************************
// Enable all constant macros
// Note: This macro must be defined before the first include of stdint.h
#if !defined(__STDC_CONSTANT_MACROS)
#define __STDC_CONSTANT_MACROS
#endif
#include <stddef.h>
#include <stdint.h>
#include <limits.h>
@ -382,18 +396,6 @@ SOFTWARE.
#define ETL_HAS_INITIALIZER_LIST 0
#endif
//*************************************
// Enable all limit macros
#if !defined(__STDC_LIMIT_MACROS)
#define __STDC_LIMIT_MACROS
#endif
//*************************************
// Enable all constant macros
#if !defined(__STDC_CONSTANT_MACROS)
#define __STDC_CONSTANT_MACROS
#endif
//*************************************
// Check for availability of certain builtins
#include "profiles/determine_builtin_support.h"