[hal] Use enums with fixed underlying type in clang C (#3297)

This will allow static analysis tools that use clang to always determine the correct intended parameter types for HAL functions.
This commit is contained in:
David Vo
2021-12-31 16:20:05 +11:00
committed by GitHub
parent 1f59ff72f9
commit 528087e308

View File

@@ -74,6 +74,11 @@ typedef int32_t HAL_Bool;
#ifdef __cplusplus
#define HAL_ENUM(name) enum name : int32_t
#elif defined(__clang__)
#define HAL_ENUM(name) \
enum name : int32_t; \
typedef enum name name; \
enum name : int32_t
#else
#define HAL_ENUM(name) \
typedef int32_t name; \