#endif
#endif // !WX_TIMEZONE && !WX_GMTOFF_IN_TM
-#if wxUSE_THREADS
+#if (!defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)) && wxUSE_THREADS && !defined(__WINDOWS__)
static wxMutex timeLock;
#endif
#if wxUSE_THREADS && !defined(__WINDOWS__)
// No need to waste time with a mutex on windows since it's using
// thread local storage for localtime anyway.
- wxMutexLocker(timeLock);
+ wxMutexLocker locker(timeLock);
#endif
memcpy(temp, localtime(ticks), sizeof(struct tm));
return temp;
#if wxUSE_THREADS && !defined(__WINDOWS__)
// No need to waste time with a mutex on windows since it's
// using thread local storage for gmtime anyway.
- wxMutexLocker(timeLock);
+ wxMutexLocker locker(timeLock);
#endif
memcpy(temp, gmtime(ticks), sizeof(struct tm));
return temp;