Define _POSIX_THREAD_SAFE_FUNCTIONS to get localtime_t declaration on