two more workarounds for compilation with -DFMT_STATIC_THOUSANDS_SEPARATOR
This commit is contained in:
@ -15,7 +15,9 @@
|
||||
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
|
||||
#include "fmt/chrono.h"
|
||||
#endif
|
||||
#include "tokenizer.h"
|
||||
|
||||
#include <cstring>
|
||||
@ -264,8 +266,15 @@ void Timer::modify_params(int narg, char **arg)
|
||||
// format timeout setting
|
||||
std::string timeout = "off";
|
||||
if (_timeout >= 0.0) {
|
||||
#if defined(FMT_STATIC_THOUSANDS_SEPARATOR)
|
||||
char outstr[200];
|
||||
struct tm *tv = gmtime(&((time_t) _timeout));
|
||||
strftime(outstr, 200, "%02d:%M:%S", tv)
|
||||
timeout = outstr;
|
||||
#else
|
||||
std::tm tv = fmt::gmtime((std::time_t) _timeout);
|
||||
timeout = fmt::format("{:02d}:{:%M:%S}", tv.tm_yday * 24 + tv.tm_hour, tv);
|
||||
#endif
|
||||
}
|
||||
|
||||
utils::logmesg(lmp, "New timer settings: style={} mode={} timeout={}\n", timer_style[_level],
|
||||
|
||||
Reference in New Issue
Block a user