Closed berolinux closed 3 months ago
libzypp uses requires as variable and method names - but in C++20 and higher, requires is a keyword. https://en.cppreference.com/w/cpp/language/requires
requires
C++20 (and higher) compilers barf on https://github.com/openSUSE/libzypp/blob/master/zypp/sat/SolvAttr.h#L67 https://github.com/openSUSE/libzypp/blob/master/zypp/sat/Solvable.h#L225 https://github.com/openSUSE/libzypp/blob/master/zypp/sat/Solvable.h#L240 https://github.com/openSUSE/libzypp/blob/master/zypp/sat/SolvableType.h#L106
and the headers from libsolv, which suffer the same problem.
A quick (but dirty) "fix" without changing the API would be adding
#define requires rpmRequires
before the problematic definitions, and
#undef requires
after.
You can already define LIBSOLV_SOLVABLE_PREPEND_DEP to rename the dependencies, e.g. requires to dep_requires.
LIBSOLV_SOLVABLE_PREPEND_DEP
dep_requires
libzypp uses
requires
as variable and method names - but in C++20 and higher,requires
is a keyword. https://en.cppreference.com/w/cpp/language/requiresC++20 (and higher) compilers barf on https://github.com/openSUSE/libzypp/blob/master/zypp/sat/SolvAttr.h#L67 https://github.com/openSUSE/libzypp/blob/master/zypp/sat/Solvable.h#L225 https://github.com/openSUSE/libzypp/blob/master/zypp/sat/Solvable.h#L240 https://github.com/openSUSE/libzypp/blob/master/zypp/sat/SolvableType.h#L106
and the headers from libsolv, which suffer the same problem.
A quick (but dirty) "fix" without changing the API would be adding
before the problematic definitions, and
after.