1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
/*
* This source code is public domain.
*
* Authors: Rani Assaf <rani@magic.metawire.com>,
* Olivier Lapicque <olivierl@jps.net>,
* Adam Goode <adam@evdebs.org> (endian and char fixes for PPC)
*/
#ifndef MP_STDAFX_H
#define MP_STDAFX_H
#ifdef _WIN32
#ifdef MSC_VER
#pragma warning (disable:4201)
#pragma warning (disable:4514)
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define srandom(_seed) srand(_seed)
#define random() rand()
#define sleep(_ms) Sleep(_ms)
#undef strcasecmp
#undef strncasecmp
#define strcasecmp(a,b) _stricmp(a,b)
#define strncasecmp(a,b,c) _strnicmp(a,b,c)
#ifndef isblank
#define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
#else
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef int8_t CHAR;
typedef uint8_t UCHAR;
typedef uint8_t* PUCHAR;
typedef uint16_t USHORT;
typedef uint32_t ULONG;
typedef uint32_t UINT;
typedef uint32_t DWORD;
typedef int32_t LONG;
typedef int64_t LONGLONG;
typedef int32_t* LPLONG;
typedef uint32_t* LPDWORD;
typedef uint16_t WORD;
typedef uint8_t BYTE;
typedef uint8_t* LPBYTE;
typedef bool BOOL;
typedef char* LPSTR;
typedef void* LPVOID;
typedef uint16_t* LPWORD;
typedef const char* LPCSTR;
typedef void* PVOID;
typedef void VOID;
inline LONG MulDiv (long a, long b, long c)
{
/*if (!c) return 0;*/
return ((uint64_t) a * (uint64_t) b ) / c;
}
#define lstrcpynA strncpy
#define lstrcpyA strcpy
#define wsprintfA sprintf
#define WAVE_FORMAT_PCM 1
#define GHND 0
#define GlobalFreePtr(p) free((void *)(p))
inline int8_t * GlobalAllocPtr(unsigned int, size_t size)
{
int8_t * p = (int8_t *) malloc(size);
if (p != NULL) memset(p, 0, size);
return p;
}
#ifndef FALSE
#define FALSE false
#endif
#ifndef TRUE
#define TRUE true
#endif
#endif /* _WIN32 */
#endif
|