]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/builddeps/dp.linux64/include/libmodplug/stdafx.h
Merge branch 'master' into divVerent/crypto2
[xonotic/xonotic.git] / misc / builddeps / dp.linux64 / 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
39 #define srandom(_seed)  srand(_seed)
40 #define random()        rand()
41 #define sleep(_ms)      Sleep(_ms)
42
43 inline void ProcessPlugins(int n) {}
44
45 #else
46
47 #include <stdlib.h>
48 #include <stdio.h>
49 #include <string.h>
50 #ifdef HAVE_MALLOC_H
51 #include <malloc.h>
52 #endif
53
54 typedef int8_t CHAR;
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;
61 typedef int32_t LONG;
62 typedef int64_t LONGLONG;
63 typedef int32_t* LPLONG;
64 typedef uint32_t* LPDWORD;
65 typedef uint16_t WORD;
66 typedef uint8_t BYTE;
67 typedef uint8_t* LPBYTE;
68 typedef bool BOOL;
69 typedef char* LPSTR;
70 typedef void* LPVOID;
71 typedef uint16_t* LPWORD;
72 typedef const char* LPCSTR;
73 typedef void* PVOID;
74 typedef void VOID;
75
76 inline LONG MulDiv (long a, long b, long c)
77 {
78   // if (!c) return 0;
79   return ((uint64_t) a * (uint64_t) b ) / c;
80 }
81
82 #define MODPLUG_NO_FILESAVE
83 #define NO_AGC
84 #define LPCTSTR LPCSTR
85 #define lstrcpyn strncpy
86 #define lstrcpy strcpy
87 #define lstrcmp strcmp
88 #define WAVE_FORMAT_PCM 1
89 //#define ENABLE_EQ
90
91 #define  GHND   0
92
93 inline int8_t * GlobalAllocPtr(unsigned int, size_t size)
94 {
95   int8_t * p = (int8_t *) malloc(size);
96
97   if (p != NULL) memset(p, 0, size);
98   return p;
99 }
100
101 inline void ProcessPlugins(int n) {}
102
103 #define GlobalFreePtr(p) free((void *)(p))
104
105 #define strnicmp(a,b,c)         strncasecmp(a,b,c)
106 #define wsprintf                        sprintf
107
108 #ifndef FALSE
109 #define FALSE   false
110 #endif
111
112 #ifndef TRUE
113 #define TRUE    true
114 #endif
115
116 #endif // _WIN32
117
118 #endif
119
120
121