diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-08 19:14:55 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-08 19:14:55 -0300 |
commit | 11cb1d1bfb6bd7e306a4bff35fe82bb937a752e0 (patch) | |
tree | 6b93d8988bf140c16bb48829419dfd92d7598600 | |
parent | c8a1f90c7a329b2e2a3c6622f9bddaea9ac56dda (diff) |
macros: Add `min()`, and `max()` macros
These macros help with finding the minimum, and maximum of two values.
-rw-r--r-- | macros.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,6 +1,9 @@ #ifndef MACROS_H #define MACROS_H +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define max(a, b) (((a) > (b)) ? (a) : (b)) + #define const_strlen(str) sizeof((char []){str}) #ifndef LOG_H |