Skip to content

Add some support for C++17-23#1719

Merged
VReaperV merged 1 commit intoDaemonEngine:masterfrom
VReaperV:c++23
Aug 15, 2025
Merged

Add some support for C++17-23#1719
VReaperV merged 1 commit intoDaemonEngine:masterfrom
VReaperV:c++23

Conversation

@VReaperV
Copy link
Contributor

@VReaperV VReaperV commented Aug 1, 2025

Add CPPStandard.h for checking C++ features support by version, replace deprecated std::result_of on >= C++17. Use the /Zc:__cplusplus for MSVC CI so it will get the correct version in CPPStandard.

.appveyor.yml Outdated
set CFLAGS=/Wv:19.29.30037

set CXXFLAGS=/Wv:19.29.30037
set CXXFLAGS=/Wv:19.29.30037 /Zc:__cplusplus
Copy link
Member

Choose a reason for hiding this comment

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

Did we lost it or do we set it too late to be useful?

  • 7a6863acmake: tell MSVC to properly report __cplusplus

From:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the CI's not picking it up for some reason.

#define CPP_14_FEATURES
#define CPP_17_FEATURES
#define CPP_20_FEATURES
#define CPP_23_FEATURES
Copy link
Member

Choose a reason for hiding this comment

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

We may name them like DAEMON_CPP_23_FEATURES like we do with other Dæmon-specific defines.

Copy link
Member

@slipher slipher left a comment

Choose a reason for hiding this comment

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

What do we need from C++20 or C++23?

@VReaperV
Copy link
Contributor Author

VReaperV commented Aug 1, 2025

What do we need from C++20 or C++23?

Daemon-vulkan currently specifically uses designated initializers, concepts, <source_location>, atomic wait/notify, and <stacktrace> from there. Additionally, <source_location> and <stacktrace> are used for better logging of various issues, with extra information being added automatically if a cvar is enabled. That part is not specific to daemon-vulkan and can be used throughout the engine and cgame/sgame (the latter 2 only with dll/native exe ofc).

Copy link
Member

@slipher slipher left a comment

Choose a reason for hiding this comment

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

Commit message should be updated

Add `CPPStandard.h` for checking C++ features support through feature test macros, replace deprecated `std::result_of` with a custom template.
@slipher
Copy link
Member

slipher commented Aug 15, 2025

LGTM

@VReaperV VReaperV merged commit 19ada47 into DaemonEngine:master Aug 15, 2025
9 checks passed
@VReaperV VReaperV deleted the c++23 branch August 15, 2025 09:31
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.

3 participants