forked from alberthdev/spasm-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstdafx.h
150 lines (118 loc) · 3.21 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
#pragma once
#ifndef _STDAFX_H
#define _STDAFX_H
#if defined(_WINDOWS)
#ifndef STRICT
#define STRICT
#endif
#include "targetver.h"
#ifdef SPASM_NG_ENABLE_COM
//#define _ATL_APARTMENT_THREADED
#define _ATL_FREE_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define _ATL_STATIC_REGISTRY
#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW
#endif
#include "resource.h"
#ifdef SPASM_NG_ENABLE_COM
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
#include <atlconv.h>
#include <atlsafe.h>
using namespace ATL;
// We don't have to really worry about this (non-ATL), but
// we'll include it in this #ifdef anyways.
#include <comutil.h>
#endif
#include <windows.h>
#include <windowsx.h>
#include <WinCrypt.h>
#include <wincon.h>
#include <fcntl.h>
#include <sys/timeb.h>
#include <direct.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
#include <tchar.h>
#include <strsafe.h>
#include <assert.h>
#include <comutil.h>
#include <comdef.h>
#include <io.h>
#include <string>
#include <unordered_map>
#include <vector>
#include <map>
//#include <vld.h>
#import <scrrun.dll> rename("FreeSpace", "FreeSpace2") no_namespace, raw_interfaces_only
#include "SPASM_h.h"
#include "gmp.h"
// Silly workarounds for WinSDK conflicts with VS2010 Express
// (a seriously buggy release of VS...)
#ifdef SPASM_NG_ENABLE_COM
// Are we using VS2010?
#if (_MSC_VER == 1600)
// The Chromium devs did it best, so I'll let them take over here...
/* Copyright 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license.
* Workaround for:
* http://connect.microsoft.com/VisualStudio/feedback/details/621653/
* http://crbug.com/225822
* Note that we can't actually include <stdint.h> here because there's other
* code in third_party that has partial versions of stdint types that conflict.
*/
#include <intsafe.h>
#undef INT8_MIN
#undef INT16_MIN
#undef INT32_MIN
#undef INT64_MIN
#undef INT8_MAX
#undef UINT8_MAX
#undef INT16_MAX
#undef UINT16_MAX
#undef INT32_MAX
#undef UINT32_MAX
#undef INT64_MAX
#undef UINT64_MAX
#endif // VS2010 check
#endif // SPASM_NG_ENABLE_COM
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <assert.h>
#include <unistd.h>
#include <ctype.h>
#include <stdarg.h>
#ifndef NO_APPSIGN
#include <gmp.h>
#include <openssl/md5.h>
#endif /* NO_APPSIGN */
#include <math.h>
#include <errno.h>
#include <stdbool.h>
#include <sys/timeb.h>
#define __inout
typedef unsigned int DWORD;
typedef const char *LPCTSTR;
typedef char *LPSTR, *LPTSTR;
typedef char TCHAR;
typedef void *LPVOID;
#define _T(z) z
#define _stricmp strcasecmp
#define _tcsdup strdup
#define _strdup strdup
#define sprintf_s sprintf
#define StringCchPrintf(dest, size, fmt, ...) snprintf(dest, size, fmt, __VA_ARGS__)
#define StringCchVPrintf(dest, size, fmt, args) vsnprintf(dest, size, fmt, args)
#define ARRAYSIZE(z) (sizeof(z)/sizeof((z)[0]))
#endif
#endif