-
Notifications
You must be signed in to change notification settings - Fork 12
/
stdafx.h
187 lines (170 loc) · 3.73 KB
/
stdafx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#ifndef _STDAFX_H
#define _STDAFX_H
#if defined(_WINDOWS)
#pragma once
#define _WIN32_LEAN_AND_MEAN
#ifndef STRICT
#define STRICT
#endif
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <winsock2.h>
#include <Windows.h>
#include <WindowsX.h>
#include <tchar.h>
#include <strsafe.h>
#include <CommCtrl.h>
#include <shlobj.h>
#include <math.h>
#include <Uxtheme.h>
#include <dwmapi.h>
#include <Ole2.h>
#include <OleIdl.h>
#include <ShObjIdl.h>
#include <assert.h>
#include <setjmp.h>
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include <stdio.h>
#include <sys/types.h>
#include <mmsystem.h>
#include <stddef.h>
#include <time.h>
#ifdef __cplusplus
#include <gdiplus.h>
using namespace Gdiplus;
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
using namespace ATL;
#include <map>
#include <list>
#include <vector>
#include <string>
namespace std
{
#ifdef UNICODE
typedef std::wstring tstring;
#else
typedef std::string tstring;
#endif
}
#endif
#elif defined(_LINUX)
#include <assert.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stddef.h>
#include <time.h>
#include <ctype.h>
#ifdef _UNICODE
#include <wchar.h>
#endif
#ifdef WXVER
#include <wx/wx.h>
#undef _T
#endif
typedef void *LPVOID;
#define MAX_PATH 256
#ifndef _T
#ifdef _UNICODE
#define _T(z) L ## z
#define TCHAR wchar_t
typedef const wchar_t *LPCTSTR;
typedef wchar_t *LPTSTR;
#define _tcscpy _tcscpy_s
#define _tcscpy_s std::wcscpy
#define _tcsncpy std::wcsncpy
//TODO: fix this to actually properly pass the size
#define _tprintf_s(buffer, format, ...) swprintf(buffer, MAX_PATH, format, __VA_ARGS__)
#define _tprintf _tprintf_s
#define _tcsicmp wcscasecmp
#define _tcscmp wcscmp
#define _tcsncmp wcsncmp
#define _putts puts
#define _tcsrchr wcsrchr
#define _tcslen wcslen
#define _tfopen_s(file, mode) fopen(wxFNCONV(file), (char *)mode)
#define _stscanf swscanf
#define _tcscat wcscat
#define _vstprintf(buffer, format, ...) vswprintf(buffer, wcslen(buffer), format, __VA_ARGS__)
#define _vftprintf vfwprintf
#define _tcsnicmp wcsncasecmp
#else
#define _T(z) z
#define TCHAR char
typedef const char *LPCTSTR;
typedef char *LPCTSTR;
#define _tprintf_s _tprintf
#define _tprintf sprintf
#define _tcsicmp strcasecmp
#define _putts puts
#define _tcsrchr strrchr
#define _tcsncpy strncpy
#define _tcscpy_s strcpy
#define _tcscpy strcpy
#define _tcslen strlen
#define _tcsncmp strncmp
#define _tcscmp strcmp
#define _tfopen_s fopen
#define _stscanf sscanf
#define _tcscat strcat
#define _vftprintf vfprintf
#define _vstprintf vsprintf
#define _tcsnicmp strncasecmp
#endif
#endif
#define _strnicmp strncasecmp
#define ARRAYSIZE(z) (sizeof(z)/sizeof((z)[0]))
#define ZeroMemory(dest, size) memset(dest, 0, size)
#elif defined(_MACVER)
#include <assert.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <stddef.h>
#include <time.h>
#include <ctype.h>
/*
typedef char TCHAR;
typedef void *LPVOID;
typedef const char *LPCTSTR;
typedef u_int8_t uint8_t;
typedef u_int16_t uint16_t;
typedef u_int32_t uint32_t;
typedef u_int8_t BYTE, *LPBYTE;
typedef u_int16_t WORD, *LPWORD;
typedef u_int32_t DWORD, *LPDWORD;
*/
/*
#ifndef TRUE
#define FALSE (0)
#define TRUE (!FALSE)
#ifdef WINVER
typedef int BOOL;
#else
typedef signed char BOOL;
#endif
#endif
*/
#define MAX_PATH 256
#define _tprintf_s printf
#define ARRAYSIZE(z) (sizeof(z)/sizeof((z)[0]))
#define _strnicmp strncasecmp
#define _tcsicmp strcasecmp
#define _putts puts
#define _tcsrchr strrchr
#define _tcscpy_s strcpy
#define _tcsncpy strncpy
#define _tcslen strlen
#define _tcscmp strcmp
#define _stscanf sscanf
#endif
#endif