X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf44a61c2410fab7cc9b71c5f2578296e44c28e7..6415637cb0da1aa1eb0b6a73b9f1757e80f53a9a:/src/common/datetime.cpp diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 12732e144b..c797fc0144 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -169,7 +169,7 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter , wxFromStringCon #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 @@ -179,7 +179,7 @@ struct tm *wxLocaltime_r(const time_t* ticks, struct tm* temp) #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; @@ -192,7 +192,7 @@ struct tm *wxGmtime_r(const time_t* ticks, struct tm* 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;