# include <string.h> /* must be included here so strdup is not redefined */
# define R_OK 4
# define HAVE_INLINE
# define INLINE_FUNCTION __inline
# define snprintf _snprintf
# define HAVE_SNPRINTF
/* MSVC has _access, not access */
#ifndef access
# define access(f, m) _access(f, m)
#endif
#define HAVE_ACCESS
/* MSVC has _stat, not stat */
# define HAVE_STAT
#include<sys/stat.h>
# define stat(a, b) _stat(a, b)
typedefstruct_statstat_type;
/* MSVC has _strdup */
# define strdup _strdup
# define HAVE_STRDUP
# define stricmp(a, b) _stricmp(a, b)
# define HAVE_STRICMP
# define strnicmp(a, b, c) _strnicmp(a, b, c)
# define HAVE_STRNICMP
# undef HAVE_STRCASECMP
# undef HAVE_STRNCASECMP
#endif
/* replacements for missing functions: */
#ifndef HAVE_STRCASECMP
# if defined(HAVE_STRICMP)
# define strcasecmp stricmp
# elif defined(HAVE__STRICMP)
# define strcasecmp _stricmp
# endif
#endif
#ifndef HAVE_STRNCASECMP
# if defined(HAVE_STRNICMP)
# define strncasecmp strnicmp
# elif defined(HAVE__STRNICMP)
# define strncasecmp _strnicmp
# endif
#endif
#ifndef HAVE_STRDUP
externchar*strdup(constchar*s);
#endif
#ifndef HAVE_SLEEP
#ifdef HAVE__SLEEP_MSEC
# define sleep(sec) _sleep(1000*sec)
#elif defined(HAVE__SLEEP)
# define sleep(sec) _sleep(sec)
#endif
#endif
#if !defined(MAX_PATH)
# if defined(PATH_MAX)
# define MAX_PATH PATH_MAX
# else
# define MAX_PATH 1024
# endif
#endif
/**** ****
**min/maxmacros**
********/
#ifndef NOMINMAX
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#endif
#if defined (__GNUC__)
# define unused(a) /* unused: a */
#elif defined (ghs) || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__KCC) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544)
# define unused(a) do {/* null */} while (&a == 0)