-
Notifications
You must be signed in to change notification settings - Fork 1
/
StdAfx.h
235 lines (192 loc) · 6.06 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// NOTE: This file is used to import libs into your project in the correct order.
// Make sure you keep this in mind when you edit this file. The correct order
// should roughly be:
// 1. MFC.
// 2. C runtime.
// 3. Other system libs. (atlsd.lib, commsup.lib, ...)
// 4. ARLAssert.
// 5. Other libs that need to be globally available.
#pragma once
#ifndef _ALLOW_RTCc_IN_STL
#define _ALLOW_RTCc_IN_STL
#endif
/* Use of the _DEBUG symbol is prohibited if you use ObjectARX. */
#if defined(_DBXAPP) || defined(_ACRXAPP)
#ifdef _DEBUG
#error Do not define the _DEBUG symbol in projects that use ObjectARX. Use SCONDEBUG instead.
#endif // _DEBUG
#endif // {ObjectARX}
/* Enable strict type checking. */
#ifndef STRICT
#define STRICT
#endif // STRICT
/* Exclude rarely-used stuff from Windows headers. */
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN
#endif // VC_EXTRALEAN
/* Specify minimum Windows version. 0x0601 = Windows 7 */
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#endif // _WIN32_WINNT
#ifndef WINVER
#define WINVER 0x0601
#endif // WINVER
/* Prevent unintentional cast operations. */
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
/* Use apartment threading. The default is _ATL_FREE_THREADED. */
#define _ATL_APARTMENT_THREADED
/* Makes ATL push/pop the current warning state when it disables
compiler warnings in 'atlbase.h', 'atlcom.h' and 'atlcore.h'. */
#define _ATL_ALL_WARNINGS
#ifdef _MANAGED
/*
* Disable the warning for initializing static or global objects compiled to MSIL. These
* initializers run from the modules .cctor which executes the first time MSIL code runs
* for that module.
*/
#pragma warning( disable : 4835 )
/*
* Ignore 'const has no effect on initonly data member'. This happens when importing managed
* types from assemblies created with the VC 7.1 compiler that have static data members.
*/
#pragma warning( disable : 4393 )
#endif // _MANAGED
/* C++ common headers. */
#include <typeinfo.h>
#include <math.h>
#include <io.h>
#include <sys/stat.h>
#include <sys/utime.h>
#include <float.h>
#include <memory.h>
#include <stdlib.h>
#include <tchar.h>
#include <stdio.h>
#include <stdarg.h>
#include <search.h>
/* STL */
#include <string>
#include <set>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <queue>
#include <functional>
#include <exception>
#include <utility>
#include <memory>
#include <algorithm>
#include <sstream>
#include <iterator>
/* AcArray and AcString */
#include <acarray.h>
#include <acadstrc.h>
#include <gedblar.h>
/* Disable warning about enumeration in qualified name. */
#pragma warning( disable : 4482 )
/* MFC support. */
#if defined(_AFXDLL) || defined(SCON_MFC_SUPPORT)
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#ifndef SCON_NO_AFXTEMPL_SUPPORT
#include <afxtempl.h> // MFC template classes
#endif //SCON_NO_AFXTEMPL_SUPPORT
struct _TREEITEM {}; // fix for warning LNK4248
struct _IMAGELIST {}; // fix for warning LNK4248
#include <AcExtensionModule.h>
#endif // MFC support.
/* ATL support. */
#if defined(_ATL_STATIC_REGISTRY) || defined(_ATL_DLL)
#include <atlbase.h>
//#ifdef SCON_ATL_COM_SUPPORT
//#include <atlcom.h>
//#endif
#include <atlstr.h>
#endif // ATL support.
// FIX: See MS-Knowledgebase article KB309801.
#ifdef __CSTRINGT_H__
#include <atlstr.h>
template class __declspec(dllimport) CStringT<TCHAR, StrTraitMFC<TCHAR, ChTraitsCRT<TCHAR> > >;
template class __declspec(dllimport) CSimpleStringT<TCHAR>;
#endif
/* C Runtime functions. */
#include <float.h>
#include <comutil.h> // _bstr_t, _variant_t
/* Standard C library. */
#include <use_ansi.h>
/* .NET Framework types. */
#ifdef _MANAGED
#pragma warning( push )
#pragma warning( disable:4091 ) // 'keyword' : ignored on left of 'type' when no variable is declared
#include <comip.h>
#include <vcclr.h>
#include <msclr/all.h>
#pragma warning( pop )
#endif
/* Windows */
#include <shlwapi.h>
/* 64 vs 32 bit Macros */
#ifdef WIN64
#define _ttol_ptr _tstoi64
#else
#define _ttol_ptr _ttol
#endif
/* Helpful macros. */
#ifndef GUID_ARRAY
#define GUID_ARRAY(name) (mscorlib::Guid*)name.asArrayPtr()
#endif
#pragma warning( push )
#pragma warning( disable: 4100 ) // unreferenced formal parameter.
#pragma warning( disable: 4239 ) // nonstandard extension used : conversion from 'type' to 'type'.
#pragma warning( disable: 4244 ) // conversion from 'type1' to 'type2', possible loss of data.
#pragma warning( disable: 4996 ) // function or variable may be unsafe.
#pragma warning( disable: 4633 ) // badly-formed XML documentation.
#pragma warning( disable: 4635 ) // badly-formed XML documentation.
#pragma warning( disable: 4638 ) // badly-formed XML documentation.
//#define _AMODELER_SUPPORT_
#include <dbxHeaders.h>
#include <arxHeaders.h>
#pragma warning( pop )
class AcDbStub {}; // fix for warning LNK4248
namespace std {
/* GUID specializations for the hash<> and equal_to<> functors. These are used by unordered_map, unordered_set, etc. */
template<>
class hash<GUID> : public unary_function<GUID, size_t>
{
public:
size_t operator()(const GUID& _Keyval) const
{
return 0;
}
};
template<>
struct equal_to<GUID> : public binary_function<GUID, GUID, bool>
{
bool operator()(const GUID& left, const GUID& right) const
{
return IsEqualGUID(left, right) != 0;
}
};
/* AcDbObjectId specialization for the hash<> functor. This is used by unordered_map, unordered_set, etc. */
template<>
class hash<AcDbObjectId>
: public std::unary_function<AcDbObjectId, size_t>
{
public:
size_t operator()(const AcDbObjectId& keyValue) const
{
return inner(reinterpret_cast<uintptr_t>(static_cast<AcDbStub*>(keyValue)));
}
private:
hash<uintptr_t> inner;
};
} // namespace std