From 8ae8c6690b41f6cd40dae14d471ce29b500c66c9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 Apr 2019 15:03:23 +0200 Subject: [PATCH] MinGW: Fix developer build In some build configurations, the build with MinGW would fail due to missing declaration of localtime_r(). This is only visible when _POSIX_THREAD_SAFE_FUNCTIONS is defined, which is achieved by including . Amends 6c543879a31d7d13a6b87e6332f6913f2f89f5e6. Task-number: QTBUG-71030 Change-Id: I71296f24a450159d1c548e1ad836a2b42e42009f Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal_p.h | 3 +++ src/corelib/tools/qdatetime.cpp | 3 +++ 2 files changed, 6 insertions(+) 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