From 9369d1d5b92bce618dd9d2c4fcf5542172c9512a Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 23 Oct 2021 21:39:16 -0600 Subject: [PATCH] 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. --- cde/programs/dtcm/libDtCmP/getdate.y | 2 +- cde/programs/dtcm/libDtCmP/timeops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtcm/libDtCmP/getdate.y b/cde/programs/dtcm/libDtCmP/getdate.y index 101f595db..b199fdeeb 100644 --- a/cde/programs/dtcm/libDtCmP/getdate.y +++ b/cde/programs/dtcm/libDtCmP/getdate.y @@ -529,7 +529,7 @@ time_t cm_getdate(char *p, struct timeb *now) lptr = p; if (now == ((struct timeb *) NULL)) { 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); lt = localtime(&tod); now->time = lt->tm_sec; diff --git a/cde/programs/dtcm/libDtCmP/timeops.c b/cde/programs/dtcm/libDtCmP/timeops.c index 82dafa5db..dcb016df4 100644 --- a/cde/programs/dtcm/libDtCmP/timeops.c +++ b/cde/programs/dtcm/libDtCmP/timeops.c @@ -1010,7 +1010,7 @@ init_time(void) _Xltimeparams localtime_buf; _Xgtimeparams gmtime_buf; -#if (defined(SVR4) || HAVE_DECL_TIMEZONE) && !defined(HAVE_TM_TM_GMTOFF) +#if defined(SVR4) /* Fix for QAR 31607 */ tzset(); if (getenv("TZ") == NULL){