diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-01-17 16:16:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-21 01:24:02 +0100 |
commit | 91d3298eab791ab2351c6be8714ab3b2bde9758e (patch) | |
tree | e288e02845f25015346af7adeb4e96ccd230f686 /src/corelib/tools/qdatetime.cpp | |
parent | 6ae1c87c756b5a8c1058a522b3a21354843fee8f (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 |