X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b52a6842651f8705d5b8cf2bfa069ee8026ec91..fd587c7a5e2424a3a29012ac3efa6fff84dba035:/include/wx/datetime.h diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 8c1e262147..80303eba3b 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -57,7 +57,7 @@ class WXDLLIMPEXP_BASE wxDateSpan; #define wxLocaltime_r localtime_r #else struct tm *wxLocaltime_r(const time_t*, struct tm*); -#if wxUSE_THREADS && !defined(__WINDOWS__) +#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 @@ -67,7 +67,7 @@ struct tm *wxLocaltime_r(const time_t*, struct tm*); #define wxGmtime_r gmtime_r #else struct tm *wxGmtime_r(const time_t*, struct tm*); -#if wxUSE_THREADS && !defined(__WINDOWS__) +#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 @@ -704,6 +704,7 @@ public: Month month = Inv_Month, int year = Inv_Year); +#if WXWIN_COMPATIBILITY_2_6 // sets the date to the given day of the given week in the year, // returns true on success and false if given date doesn't exist (e.g. // numWeek is > 53) @@ -716,6 +717,7 @@ public: wxDEPRECATED( wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First) const ); +#endif // WXWIN_COMPATIBILITY_2_6 // returns the date corresponding to the given week day of the given // week (in ISO notation) of the specified year @@ -1112,8 +1114,12 @@ public: // constructors // ------------------------------------------------------------------------ + // return the timespan for the given number of milliseconds + static wxTimeSpan Milliseconds(wxLongLong ms) { return wxTimeSpan(0, 0, 0, ms); } + static wxTimeSpan Millisecond() { return Milliseconds(1); } + // return the timespan for the given number of seconds - static wxTimeSpan Seconds(long sec) { return wxTimeSpan(0, 0, sec); } + static wxTimeSpan Seconds(wxLongLong sec) { return wxTimeSpan(0, 0, sec); } static wxTimeSpan Second() { return Seconds(1); } // return the timespan for the given number of minutes @@ -1140,8 +1146,8 @@ public: // milliseconds) inline wxTimeSpan(long hours, long minutes = 0, - long seconds = 0, - long milliseconds = 0); + wxLongLong seconds = 0, + wxLongLong milliseconds = 0); // default copy ctor is ok @@ -1891,8 +1897,8 @@ wxDateTime::FromTimezone(const wxDateTime::TimeZone& tz, bool noDST) const inline wxTimeSpan::wxTimeSpan(long hours, long minutes, - long seconds, - long milliseconds) + wxLongLong seconds, + wxLongLong milliseconds) { // assign first to avoid precision loss m_diff = hours;