some strategic documentation
[ardour.git] / libs / pbd / pbd / localtime_r.h
index 2e7c7aa1491b78536780f9f5ae39107a478a124a..2a4502481d8b139f8f77ea863c0f6f9978e581be 100644 (file)
@@ -2,6 +2,23 @@
 #define PBD_LOCALTIME_R
 #include <time.h>
 
+#ifdef COMPILER_MSVC
+
+#define localtime_r( _clock, _result ) \
+       ( *(_result) = *localtime( (_clock) ), (_result) )
+
+#elif defined COMPILER_MINGW
+
+#  ifdef localtime_r
+#  undef localtime_r
+#  endif
+
+// As in 64 bit time_t is 64 bit integer, compiler breaks compilation
+// everytime implicit cast from long int* to time_t* worked in
+// the past (32 bit). To unblock such a cast we added the localtime below:
+extern struct tm *localtime(const long int *_Time);
 extern struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
 
 #endif
+
+#endif