diff --git a/lib/utils/mu-regex.hh b/lib/utils/mu-regex.hh index 5a93b195..e36e8891 100644 --- a/lib/utils/mu-regex.hh +++ b/lib/utils/mu-regex.hh @@ -28,6 +28,10 @@ namespace Mu { * PCRE rather than std::regex because it is much faster. */ struct Regex { +#if !GLIB_CHECK_VERSION(2,74,0) /* backward compat */ +#define G_REGEX_DEFAULT (static_cast(0)) +#define G_REGEX_MATCH_DEFAULT (static_cast(0)) +#endif /** * Trivial constructor * @@ -35,7 +39,6 @@ struct Regex { */ Regex() noexcept: rx_{} {} - /** * Construct a new Regex object * @@ -47,7 +50,7 @@ struct Regex { */ static Result make(const std::string& ptrn, GRegexCompileFlags cflags = G_REGEX_DEFAULT, - GRegexMatchFlags mflags = G_REGEX_MATCH_DEFAULT) noexcept try { + GRegexMatchFlags mflags = G_REGEX_MATCH_DEFAULT) noexcept try { return Regex(ptrn.c_str(), cflags, mflags); } catch (const Error& err) { return Err(err);