Commit d217c2e4 authored by Jason Rhinelander's avatar Jason Rhinelander
Browse files

Add workaround for missing put_time in g++ < 5

parent b7353f07
Pipeline #107 skipped
......@@ -22,6 +22,17 @@ extern "C" {
#include <pwd.h>
#if defined(__GNUC__) && __GNUC__ < 5
// g++ before 5 is missing std::put_time; provide a crappy but sufficient-for-my-purposes implementation here
namespace std {
template <class CharT> std::string put_time(const std::tm *tmb, const CharT *fmt) {
char output[1024];
size_t length = strftime(output, sizeof(output), fmt, tmb);
return std::string(output);
#define RE_USERNAME "[a-zA-Z0-9._][a-zA-Z0-9._-]*"
#define RE_HOSTNAME "[a-zA-Z0-9][a-zA-Z0-9.-]*"
#define RE_HOST "(?:" RE_USERNAME "@)?" RE_HOSTNAME "(?:=\\d+)?"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment