-
Incident report
-
Resolution: Fixed
-
Trivial
-
3.0.0alpha2
-
Windows Server 2012 R2, Visual Studio 2015
Encountered compilation error while building agent on Windows:
'timezone' undeclared identifier in src/libs/zbxsysinfo/common/system.c
The problem is in these lines of system.c:
#if defined(HAVE_TM_TM_GMTOFF) gmtoff = tm->tm_gmtoff; #else gmtoff = -timezone; #endif
According to https://msdn.microsoft.com/en-us/library/ms235451%28v=vs.140%29.aspx and adjacent links, Microsoft abandoned standard in this aspect in favour of their own _underscored functions and global variables. I guess rewriting given piece of code in the following manner
#if defined(HAVE_TM_TM_GMTOFF) gmtoff = tm->tm_gmtoff; #else #ifdef _WINDOWS gmtoff = -_timezone; #else gmtoff = -timezone; #endif #endif
should fix the issue. Or we can go even further and use "safer" functional equivalents".
- is duplicated by
-
ZBX-10702 Code Error! Do with SYSTEM_LOCALTIME
- Closed