]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/time.h
Define WXDLLIMPEXP_FWD_RIBBON for consistency with all the other libraries.
[wxWidgets.git] / include / wx / time.h
index d6ff8ba04ecbeeb61fcc991b9f492c0ca6823c66..8b79d3ec578f61f0da085ccd9bc98e5b8ce63450 100644 (file)
@@ -53,4 +53,25 @@ wxLongLong WXDLLIMPEXP_BASE wxGetUTCTimeUSec();
     #endif
 #endif // HAVE_GETTIMEOFDAY
 
+/* Two wrapper functions for thread safety */
+#ifdef HAVE_LOCALTIME_R
+#define wxLocaltime_r localtime_r
+#else
+WXDLLIMPEXP_BASE struct tm *wxLocaltime_r(const time_t*, struct tm*);
+#if wxUSE_THREADS && !defined(__WINDOWS__) && !defined(__WATCOMC__)
+     // On Windows, localtime _is_ threadsafe!
+#warning using pseudo thread-safe wrapper for localtime to emulate localtime_r
+#endif
+#endif
+
+#ifdef HAVE_GMTIME_R
+#define wxGmtime_r gmtime_r
+#else
+WXDLLIMPEXP_BASE struct tm *wxGmtime_r(const time_t*, struct tm*);
+#if wxUSE_THREADS && !defined(__WINDOWS__) && !defined(__WATCOMC__)
+     // On Windows, gmtime _is_ threadsafe!
+#warning using pseudo thread-safe wrapper for gmtime to emulate gmtime_r
+#endif
+#endif
+
 #endif // _WX_TIME_H_