From 91d3298eab791ab2351c6be8714ab3b2bde9758e Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 17 Jan 2014 16:16:08 +0100 Subject: [PATCH] Fix compilation error on FreeBSD timezone is defined differently in FreeBSD compared to other (more or less) POSIX-compliant Unices. Task-number: QTBUG-36080 Change-Id: I4ad1a5ccd0b9ddbadb9fdd90edc26cf0c7252dfb Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index a95c7f53f7..f896b1d05c 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2193,6 +2193,11 @@ static int qt_timezone() long offset; _get_timezone(&offset); return offset; +#elif defined(Q_OS_BSD4) && !defined(Q_OS_DARWIN) + time_t clock = time(NULL); + struct tm t; + localtime_r(&clock, &t); + return t.tm_gmtoff; #else return timezone; #endif // Q_OS_WIN