diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-09-14 17:46:40 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2017-09-14 17:50:15 -0700 |
commit | 77f6d721564ceba589af14554685821aedfc8462 (patch) | |
tree | b37d4deb21d376a69e38e42f726b1b110806afef | |
parent | 445e9481bbe598d1eabcae7a70534c51a52c6de5 (diff) |
util: add MIN/MAX macros
-rw-r--r-- | src/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |