summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-11-13 00:27:16 +0000
committerrandomdan <randomdan@localhost>2014-11-13 00:27:16 +0000
commit23d5929c4a183e2f393887c817fd6c1bea4fe400 (patch)
treed31167e5711a3f519d56eb5f0e597d1aeba6d633
parentWrite test data to the correct paths (diff)
downloadslicer-23d5929c4a183e2f393887c817fd6c1bea4fe400.tar.bz2
slicer-23d5929c4a183e2f393887c817fd6c1bea4fe400.tar.xz
slicer-23d5929c4a183e2f393887c817fd6c1bea4fe400.zip
Fix quirk (from glibc update?) around fields in struct tm and the _BSD_SOURCE macro
-rw-r--r--Jamroot.jam2
-rw-r--r--slicer/test/conversions.cpp15
2 files changed, 10 insertions, 7 deletions
diff --git a/Jamroot.jam b/Jamroot.jam
index e02a59a..396dfd0 100644
--- a/Jamroot.jam
+++ b/Jamroot.jam
@@ -11,4 +11,4 @@ project
;
-alias all : project2 netfs ytfs ;
+alias all : project2 netfs libjsonpp p2pvr libtmdb slicer ;
diff --git a/slicer/test/conversions.cpp b/slicer/test/conversions.cpp
index a6c2c06..552135c 100644
--- a/slicer/test/conversions.cpp
+++ b/slicer/test/conversions.cpp
@@ -19,13 +19,16 @@ namespace Slicer {
std::string
dateTimeToString(const ::TestModule::DateTime & in)
{
- char buf[BUFSIZ];
- struct tm tm({ in.second, in.minute, in.hour, in.day, in.month, in.year, 0, 0, 0
-#ifdef _BSD_SOURCE
- , 0, 0
-#endif
- });
+ struct tm tm;
+ memset(&tm, 0, sizeof(struct tm));
+ tm.tm_sec = in.second;
+ tm.tm_min = in.minute;
+ tm.tm_hour = in.hour;
+ tm.tm_mday = in.day;
+ tm.tm_mon = in.month;
+ tm.tm_year = in.year;
mktime(&tm);
+ char buf[BUFSIZ];
auto len = strftime(buf, BUFSIZ, "%Y-%b-%d %H:%M:%S", &tm);
return std::string(buf, len);
}