Packages

Just-In-Time nif generator, FFI generator, C-compiler based on TinyCC. For Linux, MacOS, Windows (msys2)

Current section

Files

Jump to
niffler c_src tinycc win32 lib dllcrt1.c
Raw

c_src/tinycc/win32/lib/dllcrt1.c

//+---------------------------------------------------------------------------
#include <tchar.h>
#include <windows.h>
#include "crtinit.c"
BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved);
BOOL WINAPI _dllstart(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved)
{
BOOL bRet;
if (dwReason == DLL_PROCESS_ATTACH) /* ignore DLL_THREAD_ATTACH */
run_ctors(0, 0, 0);
bRet = DllMain (hDll, dwReason, lpReserved);
if (dwReason == DLL_PROCESS_DETACH) /* ignore DLL_THREAD_DETACH */
run_dtors();
return bRet;
}