#ifdef _POSIX_SOURCE /* MINGW doesn't seem to have these */
# define HAVE_EXECINFO
# define HAVE_MKDIR_WITH_PERMISSION
# define HAVE_SIGACTION
# define HAVE_LINK
# define HAVE_SLEEP
#endif
#endif
/* egcpp 4 dos */
#ifdef MSDOS
# include <dir.h>
# define HAVE_MKDIR_WITH_PERMISSION
#endif
/* lcc-win32 */
#ifdef __LCC__
# include <string.h>
# include <direct.h>
# include <io.h>
# define HAVE_ACCESS
# define HAVE_STAT
typedefstructstatstat_type;
# define HAVE_STRICMP
# define HAVE_STRNICMP
# define HAVE_STRDUP
# define HAVE_SLEEP
# define snprintf _snprintf
# define HAVE_SNPRINTF
# undef HAVE_STRCASECMP
# undef HAVE_STRNCASECMP
# define R_OK 4
#endif
/* Microsoft Visual C */
#ifdef _MSC_VER
# 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
#ifdef HAVE_MKDIR_WITH_PERMISSION
# define makedir(d, p) mkdir(d, p)
#elif defined(HAVE_MKDIR_WITHOUT_PERMISSION)
# define makedir(d, p) mkdir(d)
#elif defined(HAVE__MKDIR_WITHOUT_PERMISSION)
_CRTIMPint__cdecl_mkdir(constchar*);
# define makedir(d, p) _mkdir(d)
#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)