#define TRUE 1
#define FALSE 0
-#ifndef MAX
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-#ifndef MIN
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
#ifdef HAVE_TLS
#define have_tls 1
#else
#if defined(HAVE_WIN32)
typedef int64_t boffset_t;
+#define caddr_t char *
#else
typedef off_t boffset_t;
#endif
#define bmalloc(size) b_malloc(__FILE__, __LINE__, (size))
#endif
+/* Macro to simplify free/reset pointers */
+#define bfree_and_null(a) do{if(a){free(a); (a)=NULL;}} while(0)
+
/*
* Replace codes needed in both file routines and non-file routines
* Job replace codes -- in "replace"