From a92611e9ae6caf8a0864552f968a4f04e97ee28e Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Tue, 10 Apr 2001 18:32:39 +0000 Subject: Altered tclUnixTime.c in hopes of better K&R compatibility. --- ChangeLog | 5 +++++ unix/tclUnixTime.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index be856d3..f8ace39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ 2001-04-10 Kevin B. Kenny + * unix/tclUnixTime.c: Altered code to use memcpy instead of + structure assigments in an effort to achieve better K&R + compatibility. + +2001-04-10 Kevin B. Kenny * unix/tclUnixTime.c: Fixed silly typo in calls to 'gmtime' and 'localtime' that broke the Linux build. diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index dd07166..d3235b1 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTime.c,v 1.10 2001/04/10 15:43:48 kennykb Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.11 2001/04/10 18:32:39 kennykb Exp $ */ #include "tclInt.h" @@ -368,7 +368,7 @@ ThreadSafeGMTime( timePtr ) gmtime_r( timePtr, tmPtr ); #else Tcl_MutexLock( & tmMutex ); - *tmPtr = *( gmtime( timePtr ) ); + memcpy( (VOID *) tmPtr, (VOID *) gmtime( timePtr ), sizeof ( struct tm ) ); Tcl_MutexUnlock( &tmMutex ); #endif return tmPtr; @@ -409,7 +409,9 @@ ThreadSafeLocalTime( timePtr ) localtime_r( timePtr, tmPtr ); #else Tcl_MutexLock( & tmMutex ); - *tmPtr = *( localtime( timePtr ) ); + memcpy( (VOID *) (tmPtr), + (VOID *) ( localtime( timePtr ) ), + sizeof (struct tm) ); Tcl_MutexUnlock( &tmMutex ); #endif return tmPtr; -- cgit v0.12