60 lines
1.7 KiB
Plaintext
60 lines
1.7 KiB
Plaintext
$OpenBSD: patch-src_sharp_datetime_cpp,v 1.2 2011/05/08 20:38:46 jasper Exp $
|
|
|
|
Incorrect arguments to localtime_r(3) break build
|
|
Fixes bug 649472.
|
|
|
|
Upstream git: 612cf8e96aaa119d88a4ecc302fc98e3fa53f9c2
|
|
|
|
--- src/sharp/datetime.cpp.orig Thu May 5 18:30:30 2011
|
|
+++ src/sharp/datetime.cpp Thu May 5 18:31:41 2011
|
|
@@ -70,28 +70,28 @@ namespace sharp {
|
|
int DateTime::day() const
|
|
{
|
|
struct tm result;
|
|
- localtime_r(&m_date.tv_sec, &result);
|
|
+ localtime_r((const time_t *)&m_date.tv_sec, &result);
|
|
return result.tm_mday;
|
|
}
|
|
|
|
int DateTime::month() const
|
|
{
|
|
struct tm result;
|
|
- localtime_r(&m_date.tv_sec, &result);
|
|
+ localtime_r((const time_t *)&m_date.tv_sec, &result);
|
|
return result.tm_mon + 1;
|
|
}
|
|
|
|
int DateTime::year() const
|
|
{
|
|
struct tm result;
|
|
- localtime_r(&m_date.tv_sec, &result);
|
|
+ localtime_r((const time_t *)&m_date.tv_sec, &result);
|
|
return result.tm_year + 1900;
|
|
}
|
|
|
|
int DateTime::day_of_year() const
|
|
{
|
|
struct tm result;
|
|
- localtime_r(&m_date.tv_sec, &result);
|
|
+ localtime_r((const time_t *)&m_date.tv_sec, &result);
|
|
return result.tm_yday;
|
|
}
|
|
|
|
@@ -110,14 +110,14 @@ namespace sharp {
|
|
std::string DateTime::to_string(const char * format) const
|
|
{
|
|
struct tm result;
|
|
- return _to_string(format, localtime_r(&m_date.tv_sec, &result));
|
|
+ return _to_string(format, localtime_r((const time_t *)&m_date.tv_sec, &result));
|
|
}
|
|
|
|
|
|
std::string DateTime::to_short_time_string() const
|
|
{
|
|
struct tm result;
|
|
- return _to_string("%R", localtime_r(&m_date.tv_sec, &result));
|
|
+ return _to_string("%R", localtime_r((const time_t *)&m_date.tv_sec, &result));
|
|
}
|
|
|
|
std::string DateTime::to_iso8601() const
|