use strftime instead of std::put_time, for sh4 build

This commit is contained in:
Jacek Jendrzej
2019-03-18 18:37:10 +01:00
parent e8bc676f76
commit 040f329216

View File

@@ -80,8 +80,6 @@
#include <algorithm> #include <algorithm>
#include <iconv.h> #include <iconv.h>
#include <system/stacktrace.h> #include <system/stacktrace.h>
#include <ctime>
#include <iomanip>
#if 0 #if 0
#include <gui/infoicons.h> #include <gui/infoicons.h>
@@ -3227,11 +3225,13 @@ void CMoviePlayerGui::makeScreenShot(bool autoshot, bool forcover)
cover = false; cover = false;
autoshot = false; autoshot = false;
forcover = false; forcover = false;
std::time_t t = std::time(NULL); struct timeval tv;
std::tm tm = *std::localtime(&t); gettimeofday(&tv, NULL);
std::stringstream ss; char buf_time[128];
ss << std::put_time(&tm, "%Y%m%d_%H%M%S"); strftime(buf_time, sizeof(buf_time) , "_%Y%m%d_%H%M%S", localtime(&tv.tv_sec));
tmp_str = ss.str(); size_t pos = strlen(buf_time);
snprintf(&(buf_time[pos]), sizeof(buf_time) - pos - 1, "_%03d", (int) tv.tv_usec/1000);
tmp_str = buf_time;
} }
tmp_str += ending; tmp_str += ending;
std::string::size_type pos = fname.find_last_of('.'); std::string::size_type pos = fname.find_last_of('.');