Skip to content
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

Make code C++20 compatible #1615

Merged

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented Aug 16, 2023

The code is still compiled as C++11. But with this PR can also be compiled as C++14, C++17 and C++20.

  • Rename local variable requires to dep_requires.
    Compatibility with C++20. requires is a keyword in C++20.

  • Defines LIBSOLV_SOLVABLE_PREPEND_DEP.
    If defined, libsolv adds the prefix "dep_" to solvable dependencies. As a result, requires is renamed to dep_requires.
    Needed for C++20. requires is a keyword in C++20.

  • ModulePackage::createDependencies: Add "const" to std::accumulate operator

  • Change order of including header files in hawkey tests.
    Include C header files behind C++. "check.h" defines the fail(...) macro. This conflicts with the fail method in "istream", "ostream", ...
    Caught while compiling in C++20.

Defines `LIBSOLV_SOLVABLE_PREPEND_DEP`, C++20 compatibility
If defined, libsolv adds the prefix "dep_" to solvable dependencies.
As a result, `requires` is renamed to `dep_requires`.
Needed for C++20. `requires` is a keyword in C++20.
Include C header files behind C++. "check.h" defines the `fail(...)` macro.
This conflicts with the `fail` method in "istream", "ostream", ...
Caught while compiling in C++20.
Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@jan-kolarik jan-kolarik merged commit 20b0724 into rpm-software-management:dnf-4-master Aug 17, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants