Revert breaking changes.

This commit is contained in:
Andrey Akhmichin 2021-06-17 22:31:25 +05:00
parent d5d8895b8c
commit 5e06370a95
4 changed files with 17 additions and 5 deletions

View File

@ -113,7 +113,7 @@ set LIBS=user32.lib
set OUTNAME=hl.dll
set DEBUG=/debug
cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG%
cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% /def:".\hl.def"
echo -- Compile done. Cleaning...

View File

@ -43,8 +43,8 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
return TRUE;
}
// cdecl for win32
#define EXPORT2 WINAPIV
// stdcall for win32
#define EXPORT2 WINAPI
#else
#define EXPORT2
#endif

5
dlls/hl.def Normal file
View File

@ -0,0 +1,5 @@
LIBRARY hl
EXPORTS
GiveFnptrsToDll @1
SECTIONS
.data READ WRITE

View File

@ -10,8 +10,15 @@ def options(opt):
return
def configure(conf):
# stub
return
if conf.env.COMPILER_CC == 'msvc':
# hl.def removes MSVC function name decoration from GiveFnptrsToDll on Windows.
# Without this, the lookup for this function fails.
hlDefNode = conf.path.find_resource("./hl.def")
if hlDefNode is not None:
conf.env.append_unique('LINKFLAGS', '/def:%s' % hlDefNode.abspath())
else:
conf.fatal("Could not find hl.def")
def build(bld):
source = bld.path.parent.ant_glob([