Skip to content

Commit

Permalink
Detect MinGW as Windows platform w/o SEH
Browse files Browse the repository at this point in the history
Fixes #1257
  • Loading branch information
horenmar committed Apr 22, 2018
1 parent 43769a1 commit c651f23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion include/internal/catch_compiler_capabilities.h
Expand Up @@ -8,6 +8,8 @@
#ifndef TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED

#include "catch_platform.h"

// Detect a number of compiler features - by compiler
// The following features are defined:
//
Expand Down Expand Up @@ -76,6 +78,14 @@
# define CATCH_CONFIG_COLOUR_NONE
#endif



////////////////////////////////////////////////////////////////////////////////
// We know some environments not to support full POSIX signals
#if defined(__MINGW32__)
# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
#endif

////////////////////////////////////////////////////////////////////////////////
// Cygwin
#ifdef __CYGWIN__
Expand Down Expand Up @@ -126,7 +136,7 @@
#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
# define CATCH_CONFIG_COUNTER
#endif
#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH)
#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
# define CATCH_CONFIG_WINDOWS_SEH
#endif
// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
Expand Down
2 changes: 1 addition & 1 deletion include/internal/catch_platform.h
Expand Up @@ -20,7 +20,7 @@
#elif defined(linux) || defined(__linux) || defined(__linux__)
# define CATCH_PLATFORM_LINUX

#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
# define CATCH_PLATFORM_WINDOWS
#endif

Expand Down

0 comments on commit c651f23

Please sign in to comment.