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

SERVER-82285 Set ASIO_HAS_STD_INVOKE_RESULT is compiling with C++20 #1576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -3868,6 +3868,9 @@ def doConfigure(myenv):
if get_option('cxx-std') == "20" and not conf.CheckCxx20():
myenv.ConfError('C++20 support is required to build MongoDB')

if get_option('cxx-std') == "20" and conf.CheckCxx20():
Copy link
Contributor

Choose a reason for hiding this comment

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

c++20 is currently the only viable option, so theres not much reason to put this define under this condition. Also this condition is isolated to exactly c++20 and so its not forward compatible. So it should just be unconditionally added after the c++20 check above.

# ASIO will use std::result_of which was removed in c++20
# force it to use the newer alternative std::invoke_result
myenv.Append(CPPDEFINES=["ASIO_HAS_STD_INVOKE_RESULT"])

myenv.Append(CPPDEFINES=["ASIO_HAS_STD_INVOKE_RESULT"])

conf.Finish()

# C11 memset_s - a secure memset
Expand Down