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

Fix complilation wth clang in C++17 mode with -Werror -Wundef #1467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cuavas
Copy link

@cuavas cuavas commented Apr 22, 2024

clang 14 only defines __cpp_coroutines with -std=c++2a, it’s undefined with -std=c++17. This results in an undefined macro warning if you don’t check that it’s defined before comparing it to a literal with the -Wundef warning option:

In file included from asio/include/asio.hpp:18:
In file included from asio/include/asio/any_completion_executor.hpp:18:
asio/include/asio/detail/config.hpp:1317:39: error: '__cpp_coroutines' is not defined, evaluates to 0 [-Werror,-Wundef]
#    elif (__cplusplus >= 201703) && (__cpp_coroutines >= 201703)
                                      ^

This pull request adds the check to avoid the warning.

__cpp_coroutines is not defined with -std=c++17 option.
cuavas referenced this pull request in mamedev/mame Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant