--- a/HelperStructs/Style.cpp
+++ b/HelperStructs/Style.cpp
@@ -27,7 +27,9 @@
#include <iostream>
#include <string>
+#if __GNUC__ > 4
#include <regex>
+#endif
#include <array>
#include <math.h>
@@ -62,18 +64,23 @@
static const string fntsz_exp(
R"((\s*font-size\s*:\s*)([0-9]+)(pt\s*;\s*))"
);
-static regex fntsz_regex(fntsz_exp);
/* body {margin: 20px 0px 0px 0px;}*/
static const string bdmrg_exp(
R"((\s*body\s*\{\s*margin:\s*)([0-9]+)(px\s*[0-9]+px\s*[0-9]+px\s*[0-9]+px\s*;\s*\}))"
);
+#if __GNUC__ > 4
+// Programs built with gcc 4.8.4 (e.g.: Ubuntu Trusty), crash at
+// startup while building these (and also crash if we make them non-static).
+static regex fntsz_regex(fntsz_exp);
static regex bdmrg_regex(bdmrg_exp);
+#endif
string Style::scale_fonts(const string& style, float multiplier)
{
vector<string> lines;
stringToTokens(style, lines, "\n");
+#if __GNUC__ > 4
for (unsigned int ln = 0; ln < lines.size(); ln++) {
const string& line = lines[ln];
smatch m;
@@ -97,7 +104,7 @@
//cerr << "New line: [" << lines[ln] << "]\n";
}
}
-
+#endif
string nstyle = string();
for (auto& ln : lines) {
nstyle += ln + "\n";