1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

dtcm: timeops.c/getdate.y: fix fbsd build errors

Commit e0508b31 introduced build errors on FreeBSD.  This corrects
them.

HAVE_DECL_TIMEZONE should only be used to determine whether or not the
'timezone' variable is defined in a header file or whether it must be
specifically 'extern'ed.

On fbsd, a definition exists, but it is a function in libc and not an
integer timezone value that can be mutliplied or divided.
This commit is contained in:
Jon Trulson 2021-10-23 21:39:16 -06:00
parent 5754d65248
commit 9369d1d5b9
2 changed files with 2 additions and 2 deletions

View file

@ -529,7 +529,7 @@ time_t cm_getdate(char *p, struct timeb *now)
lptr = p; lptr = p;
if (now == ((struct timeb *) NULL)) { if (now == ((struct timeb *) NULL)) {
now = &ftz; now = &ftz;
#if defined(SVR4) || HAVE_DECL_TIMEZONE || defined(HAVE_TM_TM_GMTOFF) #if defined(SVR4) || (HAVE_DECL_TIMEZONE && !defined(__FreeBSD__)) || defined(HAVE_TM_TM_GMTOFF)
tod = time(0); tod = time(0);
lt = localtime(&tod); lt = localtime(&tod);
now->time = lt->tm_sec; now->time = lt->tm_sec;

View file

@ -1010,7 +1010,7 @@ init_time(void)
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
_Xgtimeparams gmtime_buf; _Xgtimeparams gmtime_buf;
#if (defined(SVR4) || HAVE_DECL_TIMEZONE) && !defined(HAVE_TM_TM_GMTOFF) #if defined(SVR4)
/* Fix for QAR 31607 */ /* Fix for QAR 31607 */
tzset(); tzset();
if (getenv("TZ") == NULL){ if (getenv("TZ") == NULL){