/*
   indirection layer for build and platform-specific definitions

   in general, this header should ensure that the stdint types are
   available, and that any optional compile flags are defined if
   the build system doesn't pass them directly.
*/

#ifndef __OS_TYPES_H
#define __OS_TYPES_H

#if defined(HAVE_STDINT_H) || defined(__MACOS__)
# include <stdint.h>
#elif defined(__VMS)
# include <inttypes.h>
#elif defined(__CYGWIN__)
# include <sys/types.h>
# if defined(OLD_CYGWIN_SYS_TYPES)
  /*
   * Old versions of Cygwin have no stdint.h but define "MS types". Some of
   * them conflict with a standard type emulation provided by config_types.h
   * so we do a fixup here.
   */
   typedef u_int8_t uint8_t;
   typedef u_int16_t uint16_t;
   typedef u_int32_t uint32_t;
#endif
#elif defined(_WIN32) && defined(_MSC_VER) /* Microsoft Visual C+*/
   typedef signed char          int8_t;
   typedef short int            int16_t;
   typedef int                  int32_t;
   typedef __int64              int64_t;
   typedef unsigned char        uint8_t;
   typedef unsigned short int   uint16_t;
   typedef unsigned int         uint32_t;
   typedef unsigned __int64     uint64_t;
#  define vsnprintf _vsnprintf
#  define snprintf _snprintf
#endif

#endif /* __OS_TYPES_H */
