[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Size and dependencies of bit.dll (LuaForWindows)
- From: J.Jørgen von Bargen <jjvb.primus@...>
- Date: Mon, 27 Sep 2010 09:26:25 +0000 (UTC)
All the time I wondered about the dependencies and size of bit.dll.
Encouraged by my work on a gpx decompression lib I twiddled
around with LuaBitOp-1.0.1 and did the following patch
+ #ifdef _WIN32
+ #pragma comment(linker, "/OPT:NOWIN98")
+ #include <windows.h>
+ BOOL WINAPI DllMain(
+ HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved
+ return TRUE;
- %MYLINK% /DLL /export:luaopen_bit /out:bit.dll bit.obj %LUA_LIB%
+ %MYLINK% /DLL /entry:"DllMain" /export:luaopen_bit /out:bit.dll
And WOW, this reduced bit.dll from 20480 to 4096 bytes and completly
removed the dependency from any msvcrt*.dll. I did not see any bad
side effects yet, the msvctest.bat runs flawlessly.
Do you have any cons for this approach?