Mercurial > audlegacy-plugins
comparison src/modplug/stdafx.h @ 2216:3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Fri, 07 Dec 2007 12:08:47 -0600 |
parents | a76855c7942e |
children | 6907fc39b53f |
comparison
equal
deleted
inserted
replaced
2198:32f9f1e4a9ec | 2216:3673c7ec4ea2 |
---|---|
7 */ | 7 */ |
8 | 8 |
9 #ifndef _STDAFX_H_ | 9 #ifndef _STDAFX_H_ |
10 #define _STDAFX_H_ | 10 #define _STDAFX_H_ |
11 | 11 |
12 #include "headers.h" | |
12 | 13 |
13 #ifdef MSC_VER | 14 #ifdef MSC_VER |
14 | 15 |
15 #pragma warning (disable:4201) | 16 #pragma warning (disable:4201) |
16 #pragma warning (disable:4514) | 17 #pragma warning (disable:4514) |
17 #include <windows.h> | 18 #include <windows.h> |
18 #include <windowsx.h> | 19 #include <windowsx.h> |
19 #include <mmsystem.h> | 20 #include <mmsystem.h> |
20 #include <stdio.h> | 21 #include <stdio.h> |
21 | 22 |
22 #elif defined(__x86_64__) || defined(__powerpc64__) | 23 inline void ProcessPlugins(int n) {} |
24 | |
25 #else | |
23 | 26 |
24 #include <stdlib.h> | 27 #include <stdlib.h> |
25 #include <stdio.h> | 28 #include <stdio.h> |
26 #include <string.h> | 29 #include <string.h> |
27 | 30 |
34 typedef unsigned int DWORD; | 37 typedef unsigned int DWORD; |
35 typedef int LONG; | 38 typedef int LONG; |
36 typedef unsigned short WORD; | 39 typedef unsigned short WORD; |
37 typedef unsigned char BYTE; | 40 typedef unsigned char BYTE; |
38 typedef unsigned char * LPBYTE; | 41 typedef unsigned char * LPBYTE; |
42 #ifdef __cplusplus | |
39 typedef bool BOOL; | 43 typedef bool BOOL; |
44 #endif | |
40 typedef char * LPSTR; | 45 typedef char * LPSTR; |
41 typedef void * LPVOID; | 46 typedef void * LPVOID; |
42 typedef int * LPLONG; | 47 typedef int * LPLONG; |
43 typedef unsigned int * LPDWORD; | 48 typedef unsigned int * LPDWORD; |
44 typedef unsigned short * LPWORD; | 49 typedef unsigned short * LPWORD; |
45 typedef const char * LPCSTR; | 50 typedef const char * LPCSTR; |
46 typedef long LONGLONG; | 51 typedef long long LONGLONG; |
47 typedef void * PVOID; | 52 typedef void * PVOID; |
48 typedef void VOID; | 53 typedef void VOID; |
49 | 54 |
50 inline LONG MulDiv (int a, int b, int c) | |
51 { | |
52 // if (!c) return 0; | |
53 return ((unsigned long)a * (unsigned long) b ) / c; | |
54 } | |
55 | 55 |
56 #define MODPLUG_NO_FILESAVE | |
57 #define NO_AGC | 56 #define NO_AGC |
58 #define LPCTSTR LPCSTR | 57 #define LPCTSTR LPCSTR |
59 #define lstrcpyn strncpy | 58 #define lstrcpyn strncpy |
60 #define lstrcpy strcpy | 59 #define lstrcpy strcpy |
61 #define lstrcmp strcmp | 60 #define lstrcmp strcmp |
62 #define WAVE_FORMAT_PCM 1 | 61 #define WAVE_FORMAT_PCM 1 |
63 //#define ENABLE_EQ | 62 //#define ENABLE_EQ |
64 | 63 |
65 #define GHND 0 | 64 #define GHND 0 |
66 | 65 |
66 #ifdef __cplusplus | |
67 inline signed char * GlobalAllocPtr(unsigned int, size_t size) | 67 inline signed char * GlobalAllocPtr(unsigned int, size_t size) |
68 { | 68 { |
69 signed char * p = (signed char *) malloc(size); | 69 signed char * p = (signed char *) malloc(size); |
70 | 70 |
71 if (p != NULL) memset(p, 0, size); | 71 if (p != NULL) memset(p, 0, size); |
72 return p; | 72 return p; |
73 } | 73 } |
74 | 74 |
75 #define GlobalFreePtr(p) free((void *)(p)) | 75 inline void ProcessPlugins(int) {} |
76 | |
77 #define strnicmp(a,b,c) strncasecmp(a,b,c) | |
78 #define wsprintf sprintf | |
79 | |
80 #ifndef FALSE | |
81 #define FALSE false | |
82 #endif | |
83 | |
84 #ifndef TRUE | |
85 #define TRUE true | |
86 #endif | |
87 | |
88 #else | |
89 | |
90 #include <stdlib.h> | |
91 #include <stdio.h> | |
92 #include <string.h> | |
93 | |
94 typedef signed char CHAR; | |
95 typedef unsigned char UCHAR; | |
96 typedef unsigned char* PUCHAR; | |
97 typedef unsigned short USHORT; | |
98 #if defined(__x86_64__) || defined(__powerpc64__) | |
99 typedef unsigned int ULONG; | |
100 typedef unsigned int UINT; | |
101 typedef unsigned int DWORD; | |
102 typedef int LONG; | |
103 typedef long LONGLONG; | |
104 typedef int * LPLONG; | |
105 typedef unsigned int * LPDWORD; | |
106 #else | |
107 typedef unsigned long ULONG; | |
108 typedef unsigned long UINT; | |
109 typedef unsigned long DWORD; | |
110 typedef long LONG; | |
111 typedef long long LONGLONG; | |
112 typedef long * LPLONG; | |
113 typedef unsigned long * LPDWORD; | |
114 #endif | |
115 typedef unsigned short WORD; | |
116 typedef unsigned char BYTE; | |
117 typedef unsigned char * LPBYTE; | |
118 typedef bool BOOL; | |
119 typedef char * LPSTR; | |
120 typedef void * LPVOID; | |
121 typedef unsigned short * LPWORD; | |
122 typedef const char * LPCSTR; | |
123 typedef void * PVOID; | |
124 typedef void VOID; | |
125 | |
126 inline LONG MulDiv (long a, long b, long c) | |
127 { | |
128 // if (!c) return 0; | |
129 return ((unsigned long long) a * (unsigned long long) b ) / c; | |
130 } | |
131 | |
132 #define MODPLUG_NO_FILESAVE | |
133 #define NO_AGC | |
134 #define LPCTSTR LPCSTR | |
135 #define lstrcpyn strncpy | |
136 #define lstrcpy strcpy | |
137 #define lstrcmp strcmp | |
138 #define WAVE_FORMAT_PCM 1 | |
139 //#define ENABLE_EQ | |
140 | |
141 #define GHND 0 | |
142 | |
143 inline signed char * GlobalAllocPtr(unsigned int, size_t size) | |
144 { | |
145 signed char * p = (signed char *) malloc(size); | |
146 | |
147 if (p != NULL) memset(p, 0, size); | |
148 return p; | |
149 } | |
150 | 76 |
151 #define GlobalFreePtr(p) free((void *)(p)) | 77 #define GlobalFreePtr(p) free((void *)(p)) |
152 | 78 |
153 #define strnicmp(a,b,c) strncasecmp(a,b,c) | 79 #define strnicmp(a,b,c) strncasecmp(a,b,c) |
154 #define wsprintf sprintf | 80 #define wsprintf sprintf |
81 #endif | |
155 | 82 |
156 #ifndef FALSE | 83 #ifndef FALSE |
157 #define FALSE false | 84 #define FALSE false |
158 #endif | 85 #endif |
159 | 86 |