summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-09-14 17:46:40 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-09-14 17:50:15 -0700
commit77f6d721564ceba589af14554685821aedfc8462 (patch)
treeb37d4deb21d376a69e38e42f726b1b110806afef /src
parent445e9481bbe598d1eabcae7a70534c51a52c6de5 (diff)
util: add MIN/MAX macros
Diffstat (limited to 'src')
-rw-r--r--src/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 549b529..7d182d8 100644
--- a/src/util.h
+++ b/src/util.h
@@ -21,6 +21,12 @@
#define cstrlen(_str) \
(sizeof(_str) - 1)
+#define MIN(_a, _b) \
+ ((_a) < (_b) ? (_a) : (_b))
+
+#define MAX(_a, _b) \
+ ((_a) > (_b) ? (_a) : (_b))
+
unsigned get_ncpus(void);
void ask_string(char *buf, int len, const char *prompt, const char *def);
void ask_num(int *res, int max, const char *prompt, int def);
© All Rights Reserved