aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-rw-r--r--common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/common.h b/common.h
index 1c41d21..f64399a 100644
--- a/common.h
+++ b/common.h
@@ -63,6 +63,16 @@
*/
#define ELEMSOF(ARRAY) (sizeof(ARRAY) / sizeof(*(ARRAY)))
+/**
+ * Select the minimum of two values
+ */
+#define MIN(A, B) ((A) < (B) ? (A) : (B))
+
+/**
+ * Select the maximum of two values
+ */
+#define MAX(A, B) ((A) > (B) ? (A) : (B))
+
#include "algorithms.h"