min/max macros

This commit is contained in:
Allen Webster
2021-08-24 21:16:33 -07:00
parent 5ef50bd3df
commit 78bfd000d4
4 changed files with 18 additions and 12 deletions
+5
View File
@@ -724,6 +724,11 @@ struct MD_FileIter
#define MD_StaticAssert(c,label) MD_u8 MD_static_assert_##label[(c)?(1):(-1)]
#define MD_ArrayCount(a) (sizeof(a) / sizeof((a)[0]))
#define MD_Min(a,b) (((a)<(b))?(a):(b))
#define MD_Max(a,b) (((a)>(b))?(a):(b))
#define MD_ClampBot(a,b) MD_Max(a,b)
#define MD_ClampTop(a,b) MD_Min(a,b)
//~ Linked List Macros.
// terminator modes