- Timestamp:
- Oct 2, 2013, 10:18:35 AM (10 years ago)
- Location:
- trunk/Utilities/Miscellaneous/StaticConstructor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/Miscellaneous/StaticConstructor
- Property svn:global-ignores
-
old new 1 1 Debug 2 2 ipch 3 Release
-
- Property svn:global-ignores
-
trunk/Utilities/Miscellaneous/StaticConstructor/StaticConstructor.cpp
r220 r221 37 37 m_nValue++; 38 38 } 39 40 ~CFoo() 41 { 42 _tprintf(_T("~CFoo()\n")); 43 } 39 44 }; 40 45 41 46 #define STATICLOCAL_PART1(type, name) \ 42 static BYTE g_pn##name##Data[sizeof (type)]; \ 43 static BOOL g_b##name##Initialized = FALSE; \ 44 type& g_##name = reinterpret_cast<type&>(g_pn##name##Data); \ 47 static type* g_p##name = NULL; \ 45 48 { \ 46 49 ATLASSERT(_pAtlModule); \ 47 50 CComCritSecLock<CComCriticalSection> Lock(_pAtlModule->m_csStaticDataInitAndTypeInfo); \ 48 if(!g_b##name##Initialized) \ 51 static CAutoPtr<type> g_pPrivate##name; \ 52 if(!g_p##name) \ 49 53 { \ 50 new (g_pn##name##Data)type(54 g_pPrivate##name.Attach(new type( 51 55 52 56 #define STATICLOCAL_PART2(type, name) \ 53 ) ; \54 g_ b##name##Initialized = TRUE; \57 )); \ 58 g_p##name = (type*) g_pPrivate##name; \ 55 59 } \ 56 } 60 } \ 61 type& g_##name = *g_p##name; 57 62 58 63 #define STATICLOCAL0(type, name) \
Note: See TracChangeset
for help on using the changeset viewer.