From 9e17c807bca49bef99dd23598b4a6cc413784a00 Mon Sep 17 00:00:00 2001 From: Malcolm Noyes Date: Thu, 10 May 2012 21:29:50 +0100 Subject: [PATCH] Add support for MINGW32 debugger --- include/internal/catch_debugger.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/internal/catch_debugger.hpp b/include/internal/catch_debugger.hpp index 64383b46..25eeafe6 100644 --- a/include/internal/catch_debugger.hpp +++ b/include/internal/catch_debugger.hpp @@ -95,6 +95,14 @@ { return IsDebuggerPresent() != 0; } +#elif defined(__MINGW32__) + extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); + extern "C" __declspec(dllimport) void __stdcall DebugBreak(); + #define BreakIntoDebugger() if (IsDebuggerPresent() ) { DebugBreak(); } + inline bool isDebuggerActive() + { + return IsDebuggerPresent() != 0; + } #else inline void BreakIntoDebugger(){} inline bool isDebuggerActive() { return false; }