Remove guards for SWIG.
Given that various other things in `re2.h` never had guards for SWIG
and that nobody ever complained, we can save ourselves some cruft...
Change-Id: I0d6aa66577d4c16c4e1ed60696a6f2144756dffe
Reviewed-on: https://code-review.googlesource.com/c/re2/+/60310
Reviewed-by: Paul Wankadia <junyer@google.com>
Reviewed-by: Julien Goodwin <julieng@google.com>
diff --git a/re2/re2.h b/re2/re2.h
index 38fdcb7..4699a7d 100644
--- a/re2/re2.h
+++ b/re2/re2.h
@@ -274,10 +274,8 @@
// Need to have the const char* and const std::string& forms for implicit
// conversions when passing string literals to FullMatch and PartialMatch.
// Otherwise the StringPiece form would be sufficient.
-#ifndef SWIG
RE2(const char* pattern);
RE2(const std::string& pattern);
-#endif
RE2(const StringPiece& pattern);
RE2(const StringPiece& pattern, const Options& options);
~RE2();
@@ -333,7 +331,6 @@
static bool FindAndConsumeN(StringPiece* input, const RE2& re,
const Arg* const args[], int n);
-#ifndef SWIG
private:
template <typename F, typename SP>
static inline bool Apply(F f, SP sp, const RE2& re) {
@@ -439,7 +436,6 @@
static bool FindAndConsume(StringPiece* input, const RE2& re, A&&... a) {
return Apply(FindAndConsumeN, input, re, Arg(std::forward<A>(a))...);
}
-#endif
// Replace the first match of "re" in "str" with "rewrite".
// Within "rewrite", backslash-escaped digits (\1 to \9) can be
@@ -913,7 +909,6 @@
});
}
-#ifndef SWIG
// Silence warnings about missing initializers for members of LazyRE2.
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 6
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
@@ -964,7 +959,6 @@
void operator=(const LazyRE2&); // disallowed
};
-#endif
namespace hooks {