Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/ATL_Deprecate.h

Issue 5750789393874944: [IE] First round of ATL removal (Closed)
Patch Set: Created June 20, 2014, 9:22 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /**
2 * \file ATL_Deprecate.h Include package for all the ATL headers, with optional forwarding to detect ATL dependencies.
3 *
4 * This header is a nexus for refactoring work to remove ATL.
5 * In forwarding-disabled mode, this is simply includes the ATL headers.
6 * With forwarding turned on, the ATL headers are included within a namespace.
7 * The particular ATL items used are then manually reintroduced into visibility.
8 * This method allows explicitly enumerating each of the symbols required to get the code to compile.
9 *
10 * When ATL is forwarded, the code does not link.
11 * The ATL DLL libraries expose symbols in the ATL namespace.
12 * The forwarded libraries use a different namespace.
13 * Thus the external symbols do not match, and the linker reports unresolved ext ernals.
14 * If desired, these externals could be linked through proxy classes,
15 * although these are not written as yet.
16 * The main purpose of this mechanism is to determine the exact scope of the ref actoring effort.
17 */
18
19 /*
20 * NDEBUG is defined for release but not for debug, so release versions never fo rward.
21 * Because the plugin doesn't link correctly with forwarding turned off, forward ing is disabled by default even for debug.
22 */
23 #define DISABLE_FORWARDING_FOR_DEBUG 1
24 #define DISABLE_ATL_FORWARDING defined(NDEBUG) || DISABLE_FORWARDING_FOR_DEBUG
25
26 #if DISABLE_ATL_FORWARDING
27
28 #include <atlbase.h>
29 #include <atlstr.h>
30 #include <atltypes.h>
31 #include <atlcom.h>
32 #include <atlhost.h>
33
34
35 #else
36
37 /*
38 * ATL requires the following includes in the global namespace.
39 */
40 #include <apiset.h>
41 #include <apisetcconv.h>
42 #include <rpc.h>
43 #include <rpcndr.h>
44 #include <pshpack8.h>
45 #include <stddef.h>
46 #include <string.h>
47 #include <malloc.h>
48 #include <mbstring.h>
49 #include <wchar.h>
50 #include <tchar.h>
51 #include <stdlib.h>
52 #include <comutil.h>
53 #include <OaIdl.h>
54 #include <ObjIdl.h>
55 #include <new>
56 #include <propsys.h>
57 #include <ShObjIdl.h>
58 #include <ShlObj.h>
59 #include <Shlwapi.h>
60 #include <MsHTML.h>
61 #include <crtdbg.h>
62 #include <ole2.h>
63 #include <MsHtmHst.h>
64
65 /*
66 * ATL is used as an explicit global namespace within ATL itself.
67 * These declarations forward the wrapped ATL namespace back into the global one .
68 * Fortuitously, none of the plugin code uses explicitly global ATL
69 */
70 namespace OLD_ATL {
71 namespace ATL {
72 }
73 }
74 namespace ATL = OLD_ATL::ATL ;
75
76 namespace OLD_ATL {
77 /*
78 * We need to bring some globals back into this namespace.
79 */
80 using ::tagVARIANT ;
81 using ::IStream ;
82
83 /*
84 * The original five ATL include files.
85 */
86 #include <atlbase.h>
87 #include <atlstr.h>
88 #include <atltypes.h>
89 #include <atlcom.h>
90 #include <atlhost.h>
91 }
92
93 using OLD_ATL::_AtlBaseModule;
94 using OLD_ATL::CAtlBaseModule;
95 using OLD_ATL::CComAggObject;
96 using OLD_ATL::CComAutoCriticalSection;
97 using OLD_ATL::CComClassFactory;
98 using OLD_ATL::CComCoClass;
99 using OLD_ATL::CComCreator;
100 using OLD_ATL::CComCreator2;
101 using OLD_ATL::CComModule;
102 using OLD_ATL::CComMultiThreadModel;
103 using OLD_ATL::CComObject;
104 using OLD_ATL::CComObjectNoLock;
105 using OLD_ATL::CComObjectRootEx;
106 using OLD_ATL::CComPtr;
107 using OLD_ATL::CComQIPtr;
108 using OLD_ATL::CComSingleThreadModel;
109 using OLD_ATL::CRect;
110 using OLD_ATL::CSimpleArray;
111 using OLD_ATL::IDispatchImpl;
112 using OLD_ATL::IObjectWithSiteImpl;
113 using OLD_ATL::OLE2T;
114
115 #endif
116
117 /*
118 * Deprecation pragmas use the compiler to identify refactoring targets.
119 */
120 #if DISABLE_ATL_FORWARDING
121 namespace ATL {
122 #else
123 namespace OLD_ATL {
124 #endif
125 #pragma deprecated( CString )
126 #pragma deprecated( CComBSTR )
127 #pragma deprecated( CComVariant )
128 #pragma deprecated( CW2A )
129 }
130
131 /*
132 * Note:
133 * The preprocessor symbols ATLASSERT and ATLTRACE appear in the source.
134 * These resolve to nothing in Release configurations.
135 * In Debug configurations, these are non-trivial.
136 * ATLASSERT resolves to an expression with _CrtDbgReportW and _CrtDbgBreak.
137 * ATLTRACE resolves to a ATL::CTraceFileAndLineInfo.
138 * These will need to be replaced or removed.
139 */
OLDNEW

Powered by Google App Engine
This is Rietveld