Skip to content

Commit

Permalink
fix mingw debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Apr 25, 2024
1 parent b34ec49 commit 4b7fe85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ LIBS = -lgdi32 -lwinmm -lpsapi -ldbghelp -lole32
CC = i686-w64-mingw32-gcc
WINDRES ?= i686-w64-mingw32-windres

ifdef DEBUG
CFLAGS += -D _DEBUG -D _DEBUG_X
endif

.PHONY: clean all
all: $(TARGET)

Expand Down
1 change: 1 addition & 0 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ REM
set PATH=C:\w64devkit\bin
make clean
make
REM make DEBUG=1
pause
5 changes: 3 additions & 2 deletions src/hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,13 @@ void hook_exit()

hook_revert((HOOKLIST*)&g_hook_hooklist);

#if defined(_DEBUG) && defined(_MSC_VER)
#if defined(_DEBUG)
#if defined(_MSC_VER)
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach((PVOID*)&real_SetUnhandledExceptionFilter, (PVOID)fake_SetUnhandledExceptionFilter);
DetourTransactionCommit();

#endif
real_SetUnhandledExceptionFilter(g_dbg_exception_filter);
#endif

Expand Down

0 comments on commit 4b7fe85

Please sign in to comment.