more fixes to bad macros

This commit is contained in:
Nic Barker 2024-09-28 21:59:55 +12:00
parent a790e21d4e
commit f1d1079faf

16
clay.h
View File

@ -112,6 +112,14 @@ static int CLAY__ELEMENT_DEFINITION_LATCH = 0;
children \
Clay__CloseElementWithChildren()
#ifdef __cplusplus
#define CLAY__ALIGNMENT(type) alignof(type)
#define CLAY__INIT(type) type
#else
#define CLAY__INIT(type) (type)
#define CLAY__ALIGNMENT(type) (offsetof(struct { char c; type x; }, x))
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -452,14 +460,6 @@ extern uint32_t Clay__debugViewWidth;
#define CLAY__MAX(x, y) (((x) > (y)) ? (x) : (y))
#define CLAY__MIN(x, y) (((x) < (y)) ? (x) : (y))
#ifdef __cplusplus
#define CLAY__ALIGNMENT(type) alignof(type)
#define CLAY__INIT(type) type
#else
#define CLAY__INIT(type) (type)
#define CLAY__ALIGNMENT(type) (offsetof(struct { char c; type x; }, x))
#endif
bool Clay__warningsEnabled = true;
Clay_String CLAY__SPACECHAR = CLAY__INIT(Clay_String) { .length = 1, .chars = " " };