mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[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:
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user