Forum OpenACS Development: Re: Win32-OpenACS Version 1.5

Collapse
Posted by Vlad Seryakov on
The problem with time in Win32 is with time_t type, it is 64bit integer so as we used to treat time_t as 32bit most of the software especially sprintf-like function will make the server to crash. Try using %T and even that crashes nsd.exe when i compiled using VC++.
Collapse
Posted by Maurizio Martignano on
Dear Vlad,
I'm glad you spotted the problem.
Starting from Visual C++ 2005, time_t is defined as a 64 bit integer. In order to go back to time_t defined as 32 bit integer it is enough to use the following define
_USE_32BIT_TIME_T
at compile time.

That's it and that's all.

Hope it helps,
Maurizio

Collapse
Posted by Vlad Seryakov on
I know about this macro but the problem still exists with binaries already compiled with time_t as 64bits. Si in any case all time_t references need to be casted to 64 por 32 bits explicitly. So basically all our changes are just explicit casts to 64bits.
Collapse
Posted by Maurizio Martignano on
Dear Vlad,
what you say is correct.
But I compiled ALL Aolserver sources with that macro on.
So the problem you mentioned doesn't exist in this case.

Cheers and once again thanks,
Maurizio