Browse Source

util: min macro

Luke Dashjr 11 years ago
parent
commit
0755315d0b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      util.h

+ 4 - 0
util.h

@@ -99,6 +99,10 @@ const char *bfg_json_obj_string(json_t *json, const char *key, const char *fail)
 
 extern const char *__json_array_string(json_t *, unsigned int entry);
 
+#ifndef min
+#  define min(a, b)  ((a) < (b) ? (a) : (b))
+#endif
+
 extern void *my_memrchr(const void *, int, size_t);
 
 extern bool isCalpha(int);