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 <iconv.h>
#include <system/stacktrace.h>
#include <ctime>
#include <iomanip>
#if 0
#include <gui/infoicons.h>
@@ -3227,11 +3225,13 @@ void CMoviePlayerGui::makeScreenShot(bool autoshot, bool forcover)
cover = false;
autoshot = false;
forcover = false;
std::time_t t = std::time(NULL);
std::tm tm = *std::localtime(&t);
std::stringstream ss;
ss << std::put_time(&tm, "%Y%m%d_%H%M%S");
tmp_str = ss.str();
struct timeval tv;
gettimeofday(&tv, NULL);
char buf_time[128];
strftime(buf_time, sizeof(buf_time) , "_%Y%m%d_%H%M%S", localtime(&tv.tv_sec));
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;
std::string::size_type pos = fname.find_last_of('.');