2009-07-30 06:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/common/hbdate.c
! Refixed for HB_HAS_LOCALTIME_R.
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-07-30 06:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* source/common/hbdate.c
|
||||
! Refixed for HB_HAS_LOCALTIME_R.
|
||||
|
||||
2009-07-30 06:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* source/common/hbdate.c
|
||||
! Fixed typos in last modif.
|
||||
|
||||
@@ -912,20 +912,20 @@ long hb_timeUTCOffset( void ) /* in seconds */
|
||||
}
|
||||
#else
|
||||
{
|
||||
struct tm * timeinfo;
|
||||
struct tm timeinfo;
|
||||
time_t current, utc, local;
|
||||
|
||||
time( ¤t );
|
||||
timeinfo = gmtime( ¤t );
|
||||
utc = mktime( timeinfo );
|
||||
# if defined( HB_HAS_LOCALTIME_R )
|
||||
localtime_r( ¤t, timeinfo );
|
||||
# else
|
||||
timeinfo = localtime( ¤t );
|
||||
# endif
|
||||
local = mktime( timeinfo );
|
||||
utc = mktime( gmtime( ¤t ) );
|
||||
|
||||
return difftime( local, utc ) + ( timeinfo->tm_isdst ? 3600 : 0 );
|
||||
#if defined( HB_HAS_LOCALTIME_R )
|
||||
localtime_r( ¤t, &timeinfo );
|
||||
#else
|
||||
timeinfo = *localtime( ¤t );
|
||||
#endif
|
||||
local = mktime( &timeinfo );
|
||||
|
||||
return difftime( local, utc ) + ( timeinfo.tm_isdst ? 3600 : 0 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user