Forum OpenACS Development: Re: localtime_s
The compiler inserts automatically the proper version of the function to be called. This is definition found in the actual Microsoft time.h file used in 64 bit:
static __inline errno_t __CRTDECL localtime_s(
_Out_ struct tm* const _Tm,
_In_ time_t const* const _Time
return _localtime64_s(_Tm, _Time);
So there's no need to check which of the two versions are to be used. I wrote the previous remark after having first checked the proper functioning of the system with the fix I proposed.
Anyhow it is your call.
The following is from Microsoft docs:
"localtime_s is an inline function which evaluates to _localtime64_s, and time_t is equivalent to __time64_t. If you need to force the compiler to interpret time_t as the old 32-bit time_t, you can define _USE_32BIT_TIME_T. Doing this will cause localtime_s to evaluate to _localtime32_s. This is not recommended because your application may fail after January 18, 2038, and it is not allowed on 64-bit platforms."
In other words, it doesn't matter if you compile with the 32 bit or 64 bit compiler: if you do not specify that define, time_t is equivalent to __time64_t and localtime_s to _localtime64_s; on the contrary if you specify that define, something you can do only with the 32 bit compiler, time_t is equivalent to __time_32_s and localtime_s is equivalent to _localtime32_s.
Naviserver build system, especially the file "Makefile.win32" already takes properly care of this define (_USE_32BIT_TIME_T).
So nothing needs to be done in the "reentrant.c" code.