Skip to content

Ready Libsolv for C++20 #3899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libmamba/ext/solv-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ target_include_directories(
solv-cpp
PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
# Avoids `libsolv`'s usage of `requires` which became a keyword in C++20. See:
# https://github.com/openSUSE/libsolv/blob/master/src/solvable.h#L38
target_compile_definitions(solv-cpp PUBLIC LIBSOLV_SOLVABLE_PREPEND_DEP)

find_package(tl-expected REQUIRED)
find_package(Libsolv REQUIRED)
Expand Down
4 changes: 2 additions & 2 deletions libmamba/ext/solv-cpp/src/solvable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ namespace solv

void ObjSolvableView::add_dependency(DependencyId dep, DependencyMarker marker) const
{
raw()->requires = ::repo_addid_dep(raw()->repo, raw()->requires, dep, marker);
raw()->dep_requires = ::repo_addid_dep(raw()->repo, raw()->dep_requires, dep, marker);
}

auto ObjSolvableViewConst::provides() const -> ObjQueue
Expand All @@ -409,7 +409,7 @@ namespace solv

void ObjSolvableView::add_provide(DependencyId dep) const
{
raw()->provides = ::repo_addid_dep(raw()->repo, raw()->provides, dep, /* marker= */ 0);
raw()->dep_provides = ::repo_addid_dep(raw()->repo, raw()->dep_provides, dep, /* marker= */ 0);
}

void ObjSolvableView::add_self_provide() const
Expand Down
Loading