2 * This source code is public domain.
4 * Authors: Rani Assaf <rani@magic.metawire.com>,
5 * Olivier Lapicque <olivierl@jps.net>,
6 * Adam Goode <adam@evdebs.org> (endian and char fixes for PPC)
12 /* Autoconf detection of stdint/inttypes */
13 #if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED)
15 # define CONFIG_H_INCLUDED 1
17 #ifdef HAVE_INTTYPES_H
18 # include <inttypes.h>
28 #pragma warning (disable:4201)
29 #pragma warning (disable:4514)
32 #define WIN32_LEAN_AND_MEAN
39 #define srandom(_seed) srand(_seed)
40 #define random() rand()
41 #define sleep(_ms) Sleep(_ms)
43 inline void ProcessPlugins(int n) {}
55 typedef uint8_t UCHAR;
56 typedef uint8_t* PUCHAR;
57 typedef uint16_t USHORT;
58 typedef uint32_t ULONG;
59 typedef uint32_t UINT;
60 typedef uint32_t DWORD;
62 typedef int64_t LONGLONG;
63 typedef int32_t* LPLONG;
64 typedef uint32_t* LPDWORD;
65 typedef uint16_t WORD;
67 typedef uint8_t* LPBYTE;
71 typedef uint16_t* LPWORD;
72 typedef const char* LPCSTR;
76 inline LONG MulDiv (long a, long b, long c)
79 return ((uint64_t) a * (uint64_t) b ) / c;
82 #define MODPLUG_NO_FILESAVE
84 #define LPCTSTR LPCSTR
85 #define lstrcpyn strncpy
86 #define lstrcpy strcpy
87 #define lstrcmp strcmp
88 #define WAVE_FORMAT_PCM 1
93 inline int8_t * GlobalAllocPtr(unsigned int, size_t size)
95 int8_t * p = (int8_t *) malloc(size);
97 if (p != NULL) memset(p, 0, size);
101 inline void ProcessPlugins(int n) {}
103 #define GlobalFreePtr(p) free((void *)(p))
105 #define strnicmp(a,b,c) strncasecmp(a,b,c)
106 #define wsprintf sprintf