X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fpbd%2Flocaltime_r.cc;h=fc16fb08b5f2d2bb179af759ed572d0b912c6b92;hb=8bb4ac0ac71c84f9ba588df76fa94be3710f7dfe;hp=26e9dcc4a46aaaaa96df82c409b71f0e4f550c58;hpb=c43ff1113d89db0250ad092b9c213092cd4b8a92;p=ardour.git diff --git a/libs/pbd/localtime_r.cc b/libs/pbd/localtime_r.cc index 26e9dcc4a4..fc16fb08b5 100644 --- a/libs/pbd/localtime_r.cc +++ b/libs/pbd/localtime_r.cc @@ -5,8 +5,8 @@ #ifndef HAVE_LOCALTIME_R #include #include -#include +#include "pbd/pthread_utils.h" #include "pbd/localtime_r.h" #ifdef localtime_r @@ -39,3 +39,19 @@ localtime_r(const time_t *const timep, struct tm *p_tm) } #endif + +#ifdef __MINGW64__ + struct tm * +__cdecl localtime(const long int *_Time) +{ + if (_Time == NULL) + { + return localtime((const time_t *const)NULL); // Unpredictable behavior in case of _Time == NULL; + } + else + { + const time_t tempTime = *_Time; + return localtime(&tempTime); + } +} +#endif