Allow using debug help API with non-MSVC compilers

MinGW64 and TDM-GCC come with imagehlp.h and can compile the code using debug
help API too, so enable wxUSE_DBGHELP when using these compilers by default
and also allow enabling it via a configure option.
This commit is contained in:
Vadim Zeitlin
2016-03-14 00:55:33 +01:00
parent f62d6bf6fd
commit 841af56084
7 changed files with 164 additions and 22 deletions

View File

@@ -1668,6 +1668,18 @@
// Crash debugging helpers
// ----------------------------------------------------------------------------
// Set this to 1 to use dbghelp.dll for providing stack traces in crash
// reports.
//
// Default is 1 if the compiler supports it, 0 for old MinGW.
//
// Recommended setting: 1, there is not much gain in disabling this
#if defined(__VISUALC__) || defined(__MINGW64_TOOLCHAIN__)
#define wxUSE_DBGHELP 1
#else
#define wxUSE_DBGHELP 0
#endif
// Set this to 1 to be able to use wxCrashReport::Generate() to create mini
// dumps of your program when it crashes (or at any other moment)
//

View File

@@ -10,8 +10,11 @@
#ifndef _WX_MSW_DEBUGHLPH_H_
#define _WX_MSW_DEBUGHLPH_H_
#include "wx/dynlib.h"
#include "wx/defs.h"
#if wxUSE_DBGHELP
#include "wx/dynlib.h"
#include "wx/msw/wrapwin.h"
#ifdef __VISUALC__
@@ -31,26 +34,6 @@
#include "wx/msw/private.h"
// wxUSE_DBGHELP can be predefined on the compiler command line to force using
// dbghelp.dll even if it's not detected or, on the contrary, avoid using even
// if it's available.
#ifndef wxUSE_DBGHELP
// The only compiler which is known to have the necessary headers is MSVC.
#ifdef __VISUALC__
// MSVC7.1 shipped with API v9 and we don't support anything earlier
// anyhow.
#if API_VERSION_NUMBER >= 9
#define wxUSE_DBGHELP 1
#else
#define wxUSE_DBGHELP 0
#endif
#else
#define wxUSE_DBGHELP 0
#endif
#endif
#if wxUSE_DBGHELP
/*
The table below shows which functions are exported by dbghelp.dll.

View File

@@ -1560,7 +1560,7 @@
// SDK components manually, you need to change this setting.
//
// Recommended setting: 1
#if defined(_MSC_VER) && _MSC_VER >= 1700 && !defined(_USING_V110_SDK71_)
#if defined(_MSC_VER) && _MSC_VER >= 1700
#define wxUSE_WINRT 1
#else
#define wxUSE_WINRT 0
@@ -1668,6 +1668,18 @@
// Crash debugging helpers
// ----------------------------------------------------------------------------
// Set this to 1 to use dbghelp.dll for providing stack traces in crash
// reports.
//
// Default is 1 if the compiler supports it, 0 for old MinGW.
//
// Recommended setting: 1, there is not much gain in disabling this
#if defined(__VISUALC__) || defined(__MINGW64_TOOLCHAIN__)
#define wxUSE_DBGHELP 1
#else
#define wxUSE_DBGHELP 0
#endif
// Set this to 1 to be able to use wxCrashReport::Generate() to create mini
// dumps of your program when it crashes (or at any other moment)
//

View File

@@ -180,6 +180,18 @@
// Crash debugging helpers
// ----------------------------------------------------------------------------
// Set this to 1 to use dbghelp.dll for providing stack traces in crash
// reports.
//
// Default is 1 if the compiler supports it, 0 for old MinGW.
//
// Recommended setting: 1, there is not much gain in disabling this
#if defined(__VISUALC__) || defined(__MINGW64_TOOLCHAIN__)
#define wxUSE_DBGHELP 1
#else
#define wxUSE_DBGHELP 0
#endif
// Set this to 1 to be able to use wxCrashReport::Generate() to create mini
// dumps of your program when it crashes (or at any other moment)
//