summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-01-05 19:29:47 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-01-05 19:29:47 +0100
commitcf0257b4d2f559a914fcafa58e5819f624dc8599 (patch)
treeb9fbccbf1e346f0832ec5abe2fb7e0d63fc38386
parenta7e73480d8a2b20d18bcbc8efd4705a95b2094a9 (diff)
Ensure we can build with APT_PKG_ABI > 601
There were some references to APT::StringView that don't make much sense anymore.
-rw-r--r--apt-pkg/deb/deblistparser.cc3
-rw-r--r--apt-pkg/deb/deblistparser.h3
-rw-r--r--test/libapt/stringview_test.cc5
3 files changed, 8 insertions, 3 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index f43060394..db3478f53 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -563,6 +563,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
return res;
}
+#if APT_PKG_ABI <= 600
const char *debListParser::ParseDepends(const char *Start,const char *Stop,
APT::StringView &Package,APT::StringView &Ver,
unsigned int &Op, bool ParseArchFlags,
@@ -580,7 +581,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
return res;
}
-
+#endif
const char *debListParser::ParseDepends(const char *Start, const char *Stop,
string_view &Package, string_view &Ver,
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index aa39bada2..637063f94 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -81,13 +81,14 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
bool const &ParseRestrictionsList = false,
std::string const &Arch = "");
+#if APT_PKG_ABI <= 600
APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop,
APT::StringView &Package,
APT::StringView &Ver, unsigned int &Op,
bool const ParseArchFlags = false, bool StripMultiArch = true,
bool const ParseRestrictionsList = false,
std::string Arch = "") APT_DEPRECATED_MSG("Use std::string_view variant instead");
-
+#endif
APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop,
std::string_view &Package,
std::string_view &Ver, unsigned int &Op,
diff --git a/test/libapt/stringview_test.cc b/test/libapt/stringview_test.cc
index 5b82a0da5..9273534af 100644
--- a/test/libapt/stringview_test.cc
+++ b/test/libapt/stringview_test.cc
@@ -1,5 +1,5 @@
-
#include <config.h>
+#include <apt-pkg/macros.h>
#include <apt-pkg/string_view.h>
#include <string>
@@ -7,6 +7,8 @@
#include "common.h"
+#if APT_PKG_ABI <= 600
+
TEST(StringViewTest,EmptyString)
{
constexpr APT::StringView defString;
@@ -94,3 +96,4 @@ TEST(StringViewTest,RFind)
EXPECT_EQ(defString.to_string().rfind('l',6), defString.rfind('l',6));
EXPECT_EQ(defString.to_string().rfind('l',11), defString.rfind('l',11));
}
+#endif