braces are important for min,max expression

This commit is contained in:
rhodes-b 2025-03-02 23:35:11 -06:00
parent 2b31cffd9f
commit a2eb832003

4
clay.h
View File

@ -50,8 +50,8 @@
// Public Macro API ------------------------
#define CLAY__MAX(x, y) (__typeof__ (x) _x = (x); __typeof__ (y) _y = (y); ((_x) > (_y)) ? (_x) : (_y))
#define CLAY__MIN(x, y) (__typeof__ (x) _x = (x); __typeof__ (y) _y = (y); ((_x) < (_y)) ? (_x) : (_y))
#define CLAY__MAX(x, y) ({__typeof__ (x) _x = (x); __typeof__ (y) _y = (y); ((_x) > (_y)) ? (_x) : (_y)})
#define CLAY__MIN(x, y) ({__typeof__ (x) _x = (x); __typeof__ (y) _y = (y); ((_x) < (_y)) ? (_x) : (_y)})
#define CLAY_TEXT_CONFIG(...) Clay__StoreTextElementConfig(CLAY__CONFIG_WRAPPER(Clay_TextElementConfig, __VA_ARGS__))