comparison src/modplug/stdafx.h @ 2218:6907fc39b53f

That didn't merge properly. I'll try again at some other point.
author William Pitcock <nenolod@atheme.org>
date Fri, 07 Dec 2007 12:13:37 -0600
parents 3673c7ec4ea2
children 107c1fed3d92
comparison
equal deleted inserted replaced
2217:6a4d667a9183 2218:6907fc39b53f
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"
13 12
14 #ifdef MSC_VER 13 #ifdef MSC_VER
15 14
16 #pragma warning (disable:4201) 15 #pragma warning (disable:4201)
17 #pragma warning (disable:4514) 16 #pragma warning (disable:4514)
18 #include <windows.h> 17 #include <windows.h>
19 #include <windowsx.h> 18 #include <windowsx.h>
20 #include <mmsystem.h> 19 #include <mmsystem.h>
21 #include <stdio.h> 20 #include <stdio.h>
22 21
23 inline void ProcessPlugins(int n) {} 22 #elif defined(__x86_64__) || defined(__powerpc64__)
24
25 #else
26 23
27 #include <stdlib.h> 24 #include <stdlib.h>
28 #include <stdio.h> 25 #include <stdio.h>
29 #include <string.h> 26 #include <string.h>
30 27
37 typedef unsigned int DWORD; 34 typedef unsigned int DWORD;
38 typedef int LONG; 35 typedef int LONG;
39 typedef unsigned short WORD; 36 typedef unsigned short WORD;
40 typedef unsigned char BYTE; 37 typedef unsigned char BYTE;
41 typedef unsigned char * LPBYTE; 38 typedef unsigned char * LPBYTE;
42 #ifdef __cplusplus
43 typedef bool BOOL; 39 typedef bool BOOL;
44 #endif
45 typedef char * LPSTR; 40 typedef char * LPSTR;
46 typedef void * LPVOID; 41 typedef void * LPVOID;
47 typedef int * LPLONG; 42 typedef int * LPLONG;
48 typedef unsigned int * LPDWORD; 43 typedef unsigned int * LPDWORD;
49 typedef unsigned short * LPWORD; 44 typedef unsigned short * LPWORD;
50 typedef const char * LPCSTR; 45 typedef const char * LPCSTR;
51 typedef long long LONGLONG; 46 typedef long LONGLONG;
52 typedef void * PVOID; 47 typedef void * PVOID;
53 typedef void VOID; 48 typedef void VOID;
54 49
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
56 #define NO_AGC 57 #define NO_AGC
57 #define LPCTSTR LPCSTR 58 #define LPCTSTR LPCSTR
58 #define lstrcpyn strncpy 59 #define lstrcpyn strncpy
59 #define lstrcpy strcpy 60 #define lstrcpy strcpy
60 #define lstrcmp strcmp 61 #define lstrcmp strcmp
61 #define WAVE_FORMAT_PCM 1 62 #define WAVE_FORMAT_PCM 1
62 //#define ENABLE_EQ 63 //#define ENABLE_EQ
63 64
64 #define GHND 0 65 #define GHND 0
65 66
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 inline void ProcessPlugins(int) {} 75 #define GlobalFreePtr(p) free((void *)(p))
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 }
76 150
77 #define GlobalFreePtr(p) free((void *)(p)) 151 #define GlobalFreePtr(p) free((void *)(p))
78 152
79 #define strnicmp(a,b,c) strncasecmp(a,b,c) 153 #define strnicmp(a,b,c) strncasecmp(a,b,c)
80 #define wsprintf sprintf 154 #define wsprintf sprintf
81 #endif
82 155
83 #ifndef FALSE 156 #ifndef FALSE
84 #define FALSE false 157 #define FALSE false
85 #endif 158 #endif
86 159