-#include <ctype.h>
-#include <string.h>
-#include <sys/types.h>
-
-#define MAX(a,b) (a > b ? a : b)
-#define MIN(a,b) (a < b ? a : b)
-
-#if defined(_WIN32)
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-typedef unsigned int u_int;
-typedef long ssize_t;
-
-/* integral mismatch, due to misuse of sector short */
-#ifndef __GNUC__
-#pragma warning (disable : 4761 )
-#endif
-
-#include <io.h>
-
-#define random rand
-#define srandom srand
-
-#define strncasecmp(s1, s2, s3) _strnicmp(s1, s2, s3)
-#define mkdir(dir,perm) _mkdir((dir))
-#ifndef F_OK
-#define F_OK 0 /* FILE existence */
-#endif
-#ifndef W_OK
-#define W_OK 02 /* Write permission */
-#endif
-#ifndef R_OK
-#define R_OK 04 /* Read permission */
-#endif
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#define MIN(a,b) ((a) < (b) ? (a) : (b))