+# ifndef max
+# define max(a, b) ((a) > (b) ? (a) : (b))
+# endif
+
+# ifndef min
+# define min(a, b) ((a) < (b) ? (a) : (b))
+# endif
+
+# ifndef max_t
+# define max_t(type, a, b) max((type) a, (type) b)
+# endif
+
+# ifndef min_t
+# define min_t(type, a, b) min((type) a, (type) b)
+# endif