From a2eb83200305fd62f4f9fc5320f9d5922e8f1a02 Mon Sep 17 00:00:00 2001 From: rhodes-b <59537185+rhodes-b@users.noreply.github.com> Date: Sun, 2 Mar 2025 23:35:11 -0600 Subject: [PATCH] braces are important for min,max expression --- clay.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clay.h b/clay.h index efd73be..90715ab 100644 --- a/clay.h +++ b/clay.h @@ -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__))