wolfssl/wolfcrypt/types.h: add WOLF_ENUM_DUMMY_LAST_ELEMENT() macro, and disable HAVE_ANONYMOUS_INLINE_AGGREGATES ifdef WOLF_C89.

This commit is contained in:
Daniel Pouzzner
2023-04-14 13:47:47 -05:00
parent d5588af0a2
commit 2bcf6bd3ca

View File

@@ -112,16 +112,22 @@ decouple library dependencies with standard string, memory and so on.
/* if a version is available, pivot on the version, otherwise guess it's /* if a version is available, pivot on the version, otherwise guess it's
* allowed, subject to override. * allowed, subject to override.
*/ */
#if !defined(__STDC__) \ #if !defined(WOLF_C89) && (!defined(__STDC__) \
|| (!defined(__STDC_VERSION__) && !defined(__cplusplus)) \ || (!defined(__STDC_VERSION__) && !defined(__cplusplus)) \
|| (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201101L)) \ || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201101L)) \
|| (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(__cplusplus) && (__cplusplus >= 201103L)))
#define HAVE_ANONYMOUS_INLINE_AGGREGATES 1 #define HAVE_ANONYMOUS_INLINE_AGGREGATES 1
#else #else
#define HAVE_ANONYMOUS_INLINE_AGGREGATES 0 #define HAVE_ANONYMOUS_INLINE_AGGREGATES 0
#endif #endif
#endif #endif
#if defined(WOLF_C89) || defined(WOLF_NO_TRAILING_ENUM_COMMAS)
#define WOLF_ENUM_DUMMY_LAST_ELEMENT(prefix) _wolf_ ## prefix ## _enum_dummy_last_element
#else
#define WOLF_ENUM_DUMMY_LAST_ELEMENT(prefix)
#endif
/* helpers for stringifying the expanded value of a macro argument rather /* helpers for stringifying the expanded value of a macro argument rather
* than its literal text: * than its literal text:
*/ */