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>
This commit is contained in:
parent
6ae1c87c75
commit
91d3298eab
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user