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
40 #define srandom(_seed) srand(_seed)
41 #define random() rand()
42 #define sleep(_ms) Sleep(_ms)
44 inline void ProcessPlugins(int n) {}
46 #define strncasecmp(a,b,c) strncmp(a,b,c)
47 #define strcasecmp(a,b) strcmp(a,b)
48 #define strnicmp(a,b,c) strncasecmp(a,b,c)
61 typedef uint8_t UCHAR;
62 typedef uint8_t* PUCHAR;
63 typedef uint16_t USHORT;
64 typedef uint32_t ULONG;
65 typedef uint32_t UINT;
66 typedef uint32_t DWORD;
68 typedef int64_t LONGLONG;
69 typedef int32_t* LPLONG;
70 typedef uint32_t* LPDWORD;
71 typedef uint16_t WORD;
73 typedef uint8_t* LPBYTE;
77 typedef uint16_t* LPWORD;
78 typedef const char* LPCSTR;
82 inline LONG MulDiv (long a, long b, long c)
85 return ((uint64_t) a * (uint64_t) b ) / c;
88 #define MODPLUG_NO_FILESAVE
90 #define LPCTSTR LPCSTR
91 #define lstrcpyn strncpy
92 #define lstrcpy strcpy
93 #define lstrcmp strcmp
94 #define WAVE_FORMAT_PCM 1
99 inline int8_t * GlobalAllocPtr(unsigned int, size_t size)
101 int8_t * p = (int8_t *) malloc(size);
103 if (p != NULL) memset(p, 0, size);
107 inline void ProcessPlugins(int n) {}
109 #define GlobalFreePtr(p) free((void *)(p))
111 #define strnicmp(a,b,c) strncasecmp(a,b,c)
112 #define wsprintf sprintf