X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_re2.cpp;h=2f0ee2998b12522227a5060980ef0c8b670d2711;hb=f471083cd0519d47c7c7a09029813ede41994f7b;hp=b97b7ec0fb37b6ebe4ff3825a888597223b7350d;hpb=0e7f74a7c8e804a0223b4d88bf637649838f0412;p=user%2Fhenk%2Fcode%2Finspircd.git
diff --git a/src/modules/extra/m_regex_re2.cpp b/src/modules/extra/m_regex_re2.cpp
index b97b7ec0f..2f0ee2998 100644
--- a/src/modules/extra/m_regex_re2.cpp
+++ b/src/modules/extra/m_regex_re2.cpp
@@ -17,18 +17,26 @@
* along with this program. If not, see .
*/
+/// $CompilerFlags: find_compiler_flags("re2" "")
+/// $LinkerFlags: find_linker_flags("re2" "-lre2")
+
+/// $PackageInfo: require_system("darwin") pkg-config re2
+/// $PackageInfo: require_system("ubuntu" "15.10") libre2-dev pkg-config
-#if defined __GNUC__
-# pragma GCC diagnostic ignored "-Wshadow"
-#endif
#include "inspircd.h"
#include "modules/regex.h"
-#include
+// Fix warnings about the use of `long long` on C++03 and
+// shadowing on GCC.
+#if defined __clang__
+# pragma clang diagnostic ignored "-Wc++11-long-long"
+#elif defined __GNUC__
+# pragma GCC diagnostic ignored "-Wlong-long"
+# pragma GCC diagnostic ignored "-Wshadow"
+#endif
-/* $CompileFlags: -std=c++11 */
-/* $LinkerFlags: -lre2 */
+#include
class RE2Regex : public Regex
{
@@ -43,7 +51,7 @@ class RE2Regex : public Regex
}
}
- bool Matches(const std::string& text)
+ bool Matches(const std::string& text) CXX11_OVERRIDE
{
return RE2::FullMatch(text, regexcl);
}
@@ -53,7 +61,7 @@ class RE2Factory : public RegexFactory
{
public:
RE2Factory(Module* m) : RegexFactory(m, "regex/re2") { }
- Regex* Create(const std::string& expr)
+ Regex* Create(const std::string& expr) CXX11_OVERRIDE
{
return new RE2Regex(expr);
}
@@ -66,7 +74,6 @@ class ModuleRegexRE2 : public Module
public:
ModuleRegexRE2() : ref(this)
{
- ServerInstance->Modules->AddService(ref);
}
Version GetVersion() CXX11_OVERRIDE