Skip to content

Commit 4b7fe85

Browse files
committedApr 25, 2024
fix mingw debug build
1 parent b34ec49 commit 4b7fe85

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
 

‎Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ LIBS = -lgdi32 -lwinmm -lpsapi -ldbghelp -lole32
88
CC = i686-w64-mingw32-gcc
99
WINDRES ?= i686-w64-mingw32-windres
1010

11+
ifdef DEBUG
12+
CFLAGS += -D _DEBUG -D _DEBUG_X
13+
endif
14+
1115
.PHONY: clean all
1216
all: $(TARGET)
1317

‎build.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ REM
55
set PATH=C:\w64devkit\bin
66
make clean
77
make
8+
REM make DEBUG=1
89
pause

‎src/hook.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -646,12 +646,13 @@ void hook_exit()
646646

647647
hook_revert((HOOKLIST*)&g_hook_hooklist);
648648

649-
#if defined(_DEBUG) && defined(_MSC_VER)
649+
#if defined(_DEBUG)
650+
#if defined(_MSC_VER)
650651
DetourTransactionBegin();
651652
DetourUpdateThread(GetCurrentThread());
652653
DetourDetach((PVOID*)&real_SetUnhandledExceptionFilter, (PVOID)fake_SetUnhandledExceptionFilter);
653654
DetourTransactionCommit();
654-
655+
#endif
655656
real_SetUnhandledExceptionFilter(g_dbg_exception_filter);
656657
#endif
657658

0 commit comments

Comments
 (0)