Skip to content

Commit

Permalink
win32: early load -luv on win32
Browse files Browse the repository at this point in the history
on win32 dynamic relocation of system dlls is tricky and unstable, when loading
aio.dll and sometimes buffile.dll it failed to relocate user32.dll.
also add the length arg for a potion_mmap fail (win32 only)
  • Loading branch information
Reini Urban committed Oct 16, 2013
1 parent 421a9e2 commit 662881a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config.mak
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ ifeq ($(shell tools/config.sh "${CC}" mingw),1)
LOADEXT = .dll
INCS += -I${PWD}/tools/dlfcn-win32/include
LIBPTH += -L${PWD}/tools/dlfcn-win32/lib
LIBS += -Llib -luv
ifneq (,$(findstring i386-mingw32-gcc,${CC}))
LIBS += -lws2_32 -lpsapi
else
Expand Down Expand Up @@ -221,6 +222,7 @@ ifeq ($(shell tools/config.sh "${CC}" cygwin),1)
CYGWIN = 1
LDFLAGS += -Wl,--major-image-version,0,--minor-image-version,1
LDDLLFLAGS = -shared
LIBS += -Llib -luv
LOADEXT = .dll
EXE = .exe
DLL = .dll
Expand Down
2 changes: 1 addition & 1 deletion core/contrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void *potion_mmap(size_t length, const char exec)
void *mem = VirtualAlloc(NULL, length, MEM_COMMIT,
exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE);
if (mem == NULL)
fprintf(stderr, "** potion_mmap failed");
fprintf(stderr, "** potion_mmap %ld failed", length);
return mem;
}

Expand Down

0 comments on commit 662881a

Please sign in to comment.