[DGD] VS2005 Build Problem/Partial Solution

Felix A. Croes felix at dworkin.nl
Thu Aug 24 21:16:01 CEST 2006


MupMail <muphicks at mups.co.uk> wrote:

> A while back I posted about a problem with DGD built under windows using
> VS2005 Pro. I finally had a spare moment today to look into this a
> little further.
>[...]
> I believe this is been caused by 2005 using int64 for the time_t
> representation. Placing a watch on t  and (time_t)t gives the same value
> for both. But the moment you place a watch on (time_t*)&t gives a very
> large 64bit value.

Thanks for looking into this!  I'll include the following as a fix
in the next release, changing the first few lines of the function:

    char *P_ctime(char *buf, Uint time)
    {
	int offset;
	time_t t;

	offset = 0;
	t = time;
	for (offset = 0; t > 2147397248; t -= 883612800, offset += 28) ;


>[...]
> The way I've worked around the problem for now is to compile DGD using
> 32bit time structures rather than 64bit. This can be done with the
> preprocessor define "_USE_32BIT_TIME_T".
> Hopefully this problem will be resolved before 2038 ;)

DGD handles time values as unsigned, so we should be good until well
after 2100.

Regards,
Dworkin



More information about the DGD mailing list