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
<unistd.h>. Amends 6c543879a3.

Task-number: QTBUG-71030
Change-Id: I71296f24a450159d1c548e1ad836a2b42e42009f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Friedemann Kleint 2019-04-17 15:03:23 +02:00
parent 9d67bf6e96
commit 8ae8c6690b
2 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,9 @@
#endif
#if defined(__cplusplus)
#ifdef Q_CC_MINGW
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
#endif
#include <time.h>
QT_BEGIN_NAMESPACE

View File

@ -58,6 +58,9 @@
#endif
#include <cmath>
#ifdef Q_CC_MINGW
# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r()
#endif
#include <time.h>
#ifdef Q_OS_WIN
# include <qt_windows.h>