]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/builddeps/dp.linux32/include/libmodplug/stdafx.h
Update DLLs
[xonotic/xonotic.git] / misc / builddeps / dp.linux32 / include / libmodplug / stdafx.h
1 /*
2  * This source code is public domain.
3  *
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)
7  */
8
9 #ifndef _STDAFX_H_
10 #define _STDAFX_H_
11
12 /* Autoconf detection of stdint/inttypes */
13 #if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED)
14 # include "config.h"
15 # define CONFIG_H_INCLUDED 1
16 #endif
17 #ifdef HAVE_INTTYPES_H
18 # include <inttypes.h>
19 #endif
20 #ifdef HAVE_STDINT_H
21 # include <stdint.h>
22 #endif
23
24
25 #ifdef _WIN32
26
27 #ifdef MSC_VER
28 #pragma warning (disable:4201)
29 #pragma warning (disable:4514)
30 #endif
31
32 #define WIN32_LEAN_AND_MEAN
33 #include <windows.h>
34 #include <windowsx.h>
35 #include <mmsystem.h>
36 #include <stdio.h>
37 #include <malloc.h>
38 #include <stdint.h>
39
40 #define srandom(_seed)  srand(_seed)
41 #define random()        rand()
42 #define sleep(_ms)      Sleep(_ms)
43
44 inline void ProcessPlugins(int n) {}
45
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)
49 #define HAVE_SINF 1
50
51 #else
52
53 #include <stdlib.h>
54 #include <stdio.h>
55 #include <string.h>
56 #ifdef HAVE_MALLOC_H
57 #include <malloc.h>
58 #endif
59
60 typedef int8_t CHAR;
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;
67 typedef int32_t LONG;
68 typedef int64_t LONGLONG;
69 typedef int32_t* LPLONG;
70 typedef uint32_t* LPDWORD;
71 typedef uint16_t WORD;
72 typedef uint8_t BYTE;
73 typedef uint8_t* LPBYTE;
74 typedef bool BOOL;
75 typedef char* LPSTR;
76 typedef void* LPVOID;
77 typedef uint16_t* LPWORD;
78 typedef const char* LPCSTR;
79 typedef void* PVOID;
80 typedef void VOID;
81
82 inline LONG MulDiv (long a, long b, long c)
83 {
84   // if (!c) return 0;
85   return ((uint64_t) a * (uint64_t) b ) / c;
86 }
87
88 #define MODPLUG_NO_FILESAVE
89 #define NO_AGC
90 #define LPCTSTR LPCSTR
91 #define lstrcpyn strncpy
92 #define lstrcpy strcpy
93 #define lstrcmp strcmp
94 #define WAVE_FORMAT_PCM 1
95 //#define ENABLE_EQ
96
97 #define  GHND   0
98
99 inline int8_t * GlobalAllocPtr(unsigned int, size_t size)
100 {
101   int8_t * p = (int8_t *) malloc(size);
102
103   if (p != NULL) memset(p, 0, size);
104   return p;
105 }
106
107 inline void ProcessPlugins(int n) {}
108
109 #define GlobalFreePtr(p) free((void *)(p))
110
111 #define strnicmp(a,b,c)         strncasecmp(a,b,c)
112 #define wsprintf                        sprintf
113
114 #ifndef FALSE
115 #define FALSE   false
116 #endif
117
118 #ifndef TRUE
119 #define TRUE    true
120 #endif
121
122 #endif // _WIN32
123
124 #endif
125
126
127