comparison OrthancFramework/SharedLibrary/DllMain.cpp @ 4063:e00f3d089991 framework

shared library of orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Jun 2020 16:40:34 +0200
parents
children 50cb0fb99e34
comparison
equal deleted inserted replaced
4062:0953b3dc3261 4063:e00f3d089991
1 /**
2
3 This file merges 2 files:
4 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp
5 ${OPENSSL_SOURCES_DIR}/crypto/dllmain.c
6
7 **/
8
9 #if defined(_WIN32) || defined(__CYGWIN__)
10 # ifdef __CYGWIN__
11 # include <windows.h>
12 # endif
13
14 #include "e_os.h"
15 #include "crypto/cryptlib.h"
16
17 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
18 {
19 switch (fdwReason)
20 {
21 case DLL_PROCESS_ATTACH:
22 //OPENSSL_cpuid_setup(); // TODO - Is this necessary?
23 break;
24
25 case DLL_THREAD_ATTACH:
26 break;
27
28 case DLL_THREAD_DETACH:
29 OPENSSL_thread_stop();
30 break;
31
32 case DLL_PROCESS_DETACH:
33 break;
34 }
35
36 return TRUE;
37 }
38
39 #endif
40
41
42 namespace boost
43 {
44 void tss_cleanup_implemented()
45 {
46 /*
47 This function's sole purpose is to cause a link error in cases where
48 automatic tss cleanup is not implemented by Boost.Threads as a
49 reminder that user code is responsible for calling the necessary
50 functions at the appropriate times (and for implementing an a
51 tss_cleanup_implemented() function to eliminate the linker's
52 missing symbol error).
53
54 If Boost.Threads later implements automatic tss cleanup in cases
55 where it currently doesn't (which is the plan), the duplicate
56 symbol error will warn the user that their custom solution is no
57 longer needed and can be removed.
58 */
59 }
60 }
61