mdbx-windows: setup DllMain() as entry and don't linking with CRT.

17 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ie3b37633ab081ca4ba2dc485e67de96df032a3df
This commit is contained in:
Leonid Yuriev
2018-10-14 12:47:29 +03:00
parent 25ab7da33e
commit ae83982811
2 changed files with 21 additions and 0 deletions

View File

@@ -27,6 +27,19 @@
static void mdbx_winnt_import(void);
#ifdef MDBX_BUILD_DLL
/* DEBUG/CHECKED builds still require MSVC's CRT for runtime checks.
*
* Therefore we don't define dll's entry point for debug/checked builds by MSVC.
* In this case MSVC's will automatically use DllMainCRTStartup() from CRT
* library, which also automatically call DllMain() from our mdbx.dll
*
* On the other side, for RELEASE builds
* we explicitly define DllMain() as the entry point and don't linking with
* any CRT libraries (IgnoreAllDefaultLibraries = Yes). */
#if !defined(_MSC_VER) || defined(NDEBUG)
#pragma comment(linker, "/ENTRY:DllMain")
#endif
BOOL APIENTRY DllMain(HANDLE module, DWORD reason, LPVOID reserved)
#else
#if !MDBX_CONFIG_MANUAL_TLS_CALLBACK