#ifndef AVIFILE_DEFAULT_H
#define AVIFILE_DEFAULT_H

#ifndef	WIN32
#ifdef HAVE_CONFIG_H
#include <config.h>	/* to get the HAVE_xxx_H defines */
#else
#include <sys/types.h>	/* we always need some types */
#endif /* HAVE_CONFIG_H */
#endif /* WIN32 */

#include <inttypes.h>	/* for int64_t */

#ifndef WIN32

#ifndef __WINE_WINDEF_H
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef long LONG;
typedef long HRESULT;
typedef unsigned long ULONG;
typedef long long LONGLONG;
typedef unsigned short* LPWSTR;
typedef const unsigned short* LPCWSTR;
#endif /* __WINE_WINDEF_H */

#if defined(__sun__) && defined(__svr4__)
/* offset_t defined in system headers */
/* typedef long long offset_t; */
#else
typedef unsigned int offset_t;
#endif /* __sun__ __svr4__ */

#ifndef __WINE_WINERROR_H
#define E_NOTIMPL 			0x80004001
#define E_NOINTERFACE			0x80004002
#define E_INVALIDARG 			0x80004003
#define E_FAIL 				0x80004005
#define REGDB_E_CLASSNOTREG		0x80040154
#endif /* __WINE_WINERROR_H */

#define VFW_E_INVALIDMEDIATYPE  	0x80040200
#define VFW_E_INVALIDSUBTYPE    	0x80040201
#define VFW_E_ALREADY_CONNECTED         0x80040204
#define VFW_E_FILTER_ACTIVE             0x80040205
#define VFW_E_NO_ACCEPTABLE_TYPES       0x80040207
#define VFW_E_NOT_CONNECTED             0x80040209
#define VFW_E_NO_ALLOCATOR              0x8004020A
#define VFW_E_NOT_RUNNING               0x80040226
#define VFW_E_TYPE_NOT_ACCEPTED         0x8004022A
#define VFW_E_SAMPLE_REJECTED           0x8004022B

/* error return codes */
#define	ICERR_OK		0
#define	ICERR_DONTDRAW		1
#define	ICERR_NEWPALETTE	2
#define	ICERR_GOTOKEYFRAME	3
#define	ICERR_STOPDRAWING	4

#define	ICERR_UNSUPPORTED	-1
#define	ICERR_BADFORMAT		-2
#define	ICERR_MEMORY		-3
#define	ICERR_INTERNAL		-4
#define	ICERR_BADFLAGS		-5
#define	ICERR_BADPARAM		-6
#define	ICERR_BADSIZE		-7
#define	ICERR_BADHANDLE		-8
#define	ICERR_CANTUPDATE	-9
#define	ICERR_ABORT		-10
#define	ICERR_ERROR		-100
#define	ICERR_BADBITDEPTH	-200
#define	ICERR_BADIMAGESIZE	-201

#define	ICERR_CUSTOM		-400

#else /* WIN32 */

/* '<Unknown'> has C-linkage specified, but returns UDT 'basic_string<char, struct ...' */
#pragma warning (disable: 4190)

/* 'std::_Tree(std::basic_string<... ': identifier was truncated to '255' characters in the debug information */
#pragma warning (disable: 4786)

/* 'unsigned char': forcing value to bool 'true' or 'false' */
#pragma warning (disable: 4800)
typedef __int64  int64_t;
typedef __int32  int32_t;
typedef __int16  int16_t;
typedef __int8   int8_t;

typedef __uint64 uint64_t;
typedef __uint32 uint32_t;
typedef __uint16 uint16_t;
typedef __uint8  uint8_t;
#endif /* WIN32 */

#define E_ERROR -2

typedef uint32_t fourcc_t;
typedef unsigned int framepos_t;
typedef unsigned int Unsigned;
typedef unsigned int streamid_t;

#endif /* AVIFILE_DEFAULT_H */
