summaryrefslogtreecommitdiff
path: root/libs/pbd/localtime_r.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/localtime_r.cc')
-rw-r--r--libs/pbd/localtime_r.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/pbd/localtime_r.cc b/libs/pbd/localtime_r.cc
index c72e3eb458..fc16fb08b5 100644
--- a/libs/pbd/localtime_r.cc
+++ b/libs/pbd/localtime_r.cc
@@ -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