]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/include/boost/thread/win32/mfc_thread_init.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / thread / include / boost / thread / win32 / mfc_thread_init.hpp
1 #ifndef BOOST_THREAD_WIN32_MFC_THREAD_INIT_HPP
2 #define BOOST_THREAD_WIN32_MFC_THREAD_INIT_HPP
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 // (C) Copyright 2008 Anthony Williams
7 // (C) Copyright 2011-2012 Vicente J. Botet Escriba
8
9
10 // check if we use MFC
11 #ifdef _AFXDLL
12 # if defined(_AFXEXT)
13
14 // can't use ExtRawDllMain from afxdllx.h as it also defines the symbol _pRawDllMain
15 extern "C"
16 inline BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID)
17 {
18 if (dwReason == DLL_PROCESS_ATTACH)
19 {
20 // save critical data pointers before running the constructors
21 AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
22 pModuleState->m_pClassInit = pModuleState->m_classList;
23 pModuleState->m_pFactoryInit = pModuleState->m_factoryList;
24 pModuleState->m_classList.m_pHead = NULL;
25 pModuleState->m_factoryList.m_pHead = NULL;
26 }
27 return TRUE; // ok
28 }
29
30 extern "C" __declspec(selectany) BOOL (WINAPI * const _pRawDllMainOrig)(HANDLE, DWORD, LPVOID) = &ExtRawDllMain;
31
32 # elif defined(_USRDLL)
33
34 extern "C" BOOL WINAPI RawDllMain(HANDLE, DWORD dwReason, LPVOID);
35 extern "C" __declspec(selectany) BOOL (WINAPI * const _pRawDllMainOrig)(HANDLE, DWORD, LPVOID) = &RawDllMain;
36
37 # endif
38 #endif
39
40 #endif