From edea29d59f5449047bb5919fe091d8d5ef1eb890 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Sun, 21 Mar 2021 12:28:10 +0100 Subject: [PATCH] Fix issue #397 occuring with recent versions of the MinGW compiler --- src/JSBSim.cpp | 4 ++-- src/models/flight_control/FGMagnetometer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JSBSim.cpp b/src/JSBSim.cpp index 8f3828f468..b609bf0dae 100644 --- a/src/JSBSim.cpp +++ b/src/JSBSim.cpp @@ -494,7 +494,7 @@ int real_main(int argc, char* argv[]) time_t tod; time(&tod); struct tm local; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) localtime_s(&local, &tod); #else localtime_r(&tod, &local); @@ -565,7 +565,7 @@ int real_main(int argc, char* argv[]) // PRINT ENDING CLOCK TIME time(&tod); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) localtime_s(&local, &tod); #else localtime_r(&tod, &local); diff --git a/src/models/flight_control/FGMagnetometer.cpp b/src/models/flight_control/FGMagnetometer.cpp index bee2e7b6ea..14218bde07 100644 --- a/src/models/flight_control/FGMagnetometer.cpp +++ b/src/models/flight_control/FGMagnetometer.cpp @@ -75,7 +75,7 @@ FGMagnetometer::FGMagnetometer(FGFCS* fcs, Element* element) time_t rawtime; time( &rawtime ); struct tm ptm; - #ifdef _MSC_VER + #if defined(_MSC_VER) || defined(__MINGW32__) gmtime_s(&ptm, &rawtime); #else gmtime_r(&rawtime, &ptm);