diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h index d52f6268e4..58bc8b7bf3 100644 --- a/src/corelib/global/qglobal_p.h +++ b/src/corelib/global/qglobal_p.h @@ -61,6 +61,9 @@ #endif #if defined(__cplusplus) +#ifdef Q_CC_MINGW +# include // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r() +#endif #include QT_BEGIN_NAMESPACE diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 80d6dada60..511dbf0db8 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -58,6 +58,9 @@ #endif #include +#ifdef Q_CC_MINGW +# include // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r() +#endif #include #ifdef Q_OS_WIN # include