Additional defines

This commit is contained in:
2026-09-15 14:40:44 -05:00
parent 2725166ca4
commit 2044f93af8
+24
View File
@@ -288,4 +288,28 @@ _Static_assert(
typedef const name##_t* name##_iptr_t; \
struct name
/**
* @def define_union
* @brief Defines a union and its pointer types.
* @details This simplifies the way we typically define our unions, in which
* we define the union itself and type definitions for the mutable
* and immutable pointers to that union.
* @param name The name of the union.
*/
#define define_union(name) \
typedef union name name##_t; \
typedef name##_t* name##_mptr_t; \
typedef const name##_t* name##_iptr_t; \
union name
/**
* @def define_enum
* @brief Defines an enumeration.
* @details This simplifies the way we typically define our enumerations.
* @param name The name of the structure.
*/
#define define_enum(name) \
typedef enum name name##_t; \
enum name
#endif /* MALUNAL_TYPES_HEADER */