Reverted regex to boost::regex as the C++11 regex seems to be broken
on Linux/gcc 4.9.
This commit is contained in:
parent
8acd51fc62
commit
fed5128b7f
1 changed files with 11 additions and 3 deletions
|
@ -2,7 +2,6 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <regex>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <stdlib.h> // provides **_environ
|
#include <stdlib.h> // provides **_environ
|
||||||
|
@ -51,6 +50,15 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
// #define USE_CPP11_REGEX
|
||||||
|
#ifdef USE_CPP11_REGEX
|
||||||
|
#include <regex>
|
||||||
|
#define SLIC3R_REGEX_NAMESPACE std
|
||||||
|
#else /* USE_CPP11_REGEX */
|
||||||
|
#include <boost/regex.hpp>
|
||||||
|
#define SLIC3R_REGEX_NAMESPACE boost
|
||||||
|
#endif /* USE_CPP11_REGEX */
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
PlaceholderParser::PlaceholderParser()
|
PlaceholderParser::PlaceholderParser()
|
||||||
|
@ -424,13 +432,13 @@ namespace client
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
std::string pattern(++ rhs.begin(), -- rhs.end());
|
std::string pattern(++ rhs.begin(), -- rhs.end());
|
||||||
bool result = std::regex_match(*subject, std::regex(pattern));
|
bool result = SLIC3R_REGEX_NAMESPACE::regex_match(*subject, SLIC3R_REGEX_NAMESPACE::regex(pattern));
|
||||||
if (op == '!')
|
if (op == '!')
|
||||||
result = ! result;
|
result = ! result;
|
||||||
lhs.reset();
|
lhs.reset();
|
||||||
lhs.type = TYPE_BOOL;
|
lhs.type = TYPE_BOOL;
|
||||||
lhs.data.b = result;
|
lhs.data.b = result;
|
||||||
} catch (std::regex_error &ex) {
|
} catch (SLIC3R_REGEX_NAMESPACE::regex_error &ex) {
|
||||||
// Syntax error in the regular expression
|
// Syntax error in the regular expression
|
||||||
boost::throw_exception(qi::expectation_failure<Iterator>(
|
boost::throw_exception(qi::expectation_failure<Iterator>(
|
||||||
rhs.begin(), rhs.end(), spirit::info(std::string("*Regular expression compilation failed: ") + ex.what())));
|
rhs.begin(), rhs.end(), spirit::info(std::string("*Regular expression compilation failed: ") + ex.what())));
|
||||||
|
|
Loading…
Reference in a new issue