hi,
Apparently MinGW hasn't got localtime_r, and I was concerned about the non thread safeness of using localtime.
I've added localtime_r to my code with the following;
Is that actually safe, or is it merely minimising potential problems?Code:#ifdef Win32 inline struct tm* localtime_r (const time_t *clock, struct tm *result) { if (!clock || !result) return NULL; memcpy(result,localtime(clock),sizeof(*result)); return result; } #endif
nik




Reply With Quote