1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtcm: change to detect TZ offset way with configure

This commit is contained in:
OBATA Akio 2021-10-23 14:24:40 +09:00
parent 87bdee3d19
commit e0508b3130
4 changed files with 20 additions and 6 deletions

View file

@ -403,6 +403,9 @@ AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long]) AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([time_t]) AC_CHECK_SIZEOF([time_t])
AC_CHECK_DECLS([timezone])
AC_CHECK_MEMBERS([struct tm.tm_gmtoff])
dnl jpeg dnl jpeg
AC_CHECK_LIB(jpeg, jpeg_read_header, [JPEGLIB="-ljpeg"], AC_CHECK_LIB(jpeg, jpeg_read_header, [JPEGLIB="-ljpeg"],
[AC_MSG_ERROR([libjpeg not found, please install it])], [AC_MSG_ERROR([libjpeg not found, please install it])],

View file

@ -40,6 +40,9 @@ static char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 1993 Sun Microsystems
/* University of North Carolina at Chapel Hill */ /* University of North Carolina at Chapel Hill */
/* @(#)getdate.y 2.6 4/20/84 */ /* @(#)getdate.y 2.6 4/20/84 */
#ifdef HAVE_CONFIG_H
#include <autotools_config.h>
#endif
#include <EUSCompat.h> #include <EUSCompat.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
@ -67,7 +70,7 @@ static char sccsid[] = "@(#)getdate.y 1.10 94/11/07 Copyr 1993 Sun Microsystems
#define STANDARD 2 #define STANDARD 2
#define MAYBE 3 #define MAYBE 3
#ifdef SVR4 #if defined(SVR4) && !HAVE_DECL_TIMEZONE
extern long timezone; extern long timezone;
#endif #endif
@ -526,11 +529,11 @@ 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) || defined(__OpenBSD__) #if defined(SVR4) || HAVE_DECL_TIMEZONE || 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;
#ifdef __OpenBSD__ #ifdef HAVE_TM_TM_GMTOFF
now->timezone = - lt->tm_gmtoff / 60; now->timezone = - lt->tm_gmtoff / 60;
#else #else
now->timezone = timezone/60; now->timezone = timezone/60;

View file

@ -51,6 +51,9 @@
static char sccsid[] = "@(#)timeops.c 1.13 95/05/02 Copyr 1991 Sun Microsystems, Inc."; static char sccsid[] = "@(#)timeops.c 1.13 95/05/02 Copyr 1991 Sun Microsystems, Inc.";
#endif #endif
#ifdef HAVE_CONFIG_H
#include <autotools_config.h>
#endif
#include <EUSCompat.h> #include <EUSCompat.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -1007,7 +1010,7 @@ init_time(void)
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
_Xgtimeparams gmtime_buf; _Xgtimeparams gmtime_buf;
#ifdef SVR4 #if (defined(SVR4) || HAVE_DECL_TIMEZONE) && !defined(HAVE_TM_TM_GMTOFF)
/* Fix for QAR 31607 */ /* Fix for QAR 31607 */
tzset(); tzset();
if (getenv("TZ") == NULL){ if (getenv("TZ") == NULL){

View file

@ -32,6 +32,9 @@
* version 4 of calendar manager rpc protocol functions. * version 4 of calendar manager rpc protocol functions.
*/ */
#ifdef HAVE_CONFIG_H
#include <autotools_config.h>
#endif
#include <EUSCompat.h> #include <EUSCompat.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -1416,8 +1419,10 @@ extern long *
_DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq) _DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq)
{ {
static long gmtoff; static long gmtoff;
#if !defined(CSRG_BASED) #if !defined(HAVE_STRUCT_TM_TM_GMTOFF)
# if !HAVE_DECL_TIMEZONE
extern long timezone; extern long timezone;
# endif
#else #else
_Xltimeparams localtime_buf; _Xltimeparams localtime_buf;
time_t ctime; time_t ctime;
@ -1427,7 +1432,7 @@ _DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq)
if (debug) if (debug)
fprintf(stderr, "_DtCm_rtable_gmtoff_4_svc called\n"); fprintf(stderr, "_DtCm_rtable_gmtoff_4_svc called\n");
#if defined(CSRG_BASED) #if defined(HAVE_STRUCT_TM_TM_GMTOFF)
ctime = time(NULL); ctime = time(NULL);
t = _XLocaltime(&ctime, localtime_buf); t = _XLocaltime(&ctime, localtime_buf);
gmtoff = - t->tm_gmtoff; gmtoff = - t->tm_gmtoff;