Commit 2dad1298ad14029c98c9bdf663e2953c7173fbbb

Steffen Jaeckel 2017-04-01T00:35:03

only define MIN/MAX if they are not defined yet This closes #72

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/tommath_private.h b/tommath_private.h
index bc7cd35..0e0059b 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -18,9 +18,13 @@
 #include <tommath.h>
 #include <ctype.h>
 
-#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+#ifndef MIN
+  #define MIN(x,y) (((x) < (y)) ? (x) : (y))
+#endif
 
-#define MAX(x,y) (((x) > (y)) ? (x) : (y))
+#ifndef MAX
+  #define MAX(x,y) (((x) > (y)) ? (x) : (y))
+#endif
 
 #ifdef __cplusplus
 extern "C" {