Fixes for MinGW compatibility

Some versions of MinGW do not support enough of Win32 API to let us work
with SEH, so SEH is now MSVC only (+ configurable toggle).

Also made use of gmtime_s MSVC only (as oposed to Windows only).

Fixes #805
This commit is contained in:
Martin Hořeňovský
2017-02-06 01:43:53 +01:00
parent 7e7c813486
commit e991c006b7
4 changed files with 29 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ namespace Catch {
std::time(&rawtime);
const size_t timeStampSize = sizeof("2017-01-16T17:06:45Z");
#ifdef CATCH_PLATFORM_WINDOWS
#ifdef _MSC_VER
std::tm timeInfo = {};
gmtime_s(&timeInfo, &rawtime);
#else
@@ -37,7 +37,7 @@ namespace Catch {
char timeStamp[timeStampSize];
const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
#ifdef CATCH_PLATFORM_WINDOWS
#ifdef _MSC_VER
std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
#else
std::strftime(timeStamp, timeStampSize, fmt, timeInfo);