Skip to content

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

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

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

Conversation

@VReaperV

@VReaperV VReaperV commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

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.

Comment thread .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
Copy Markdown
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
Copy Markdown
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.

Comment thread src/common/CPPStandard.h Outdated
#define CPP_14_FEATURES
#define CPP_17_FEATURES
#define CPP_20_FEATURES
#define CPP_23_FEATURES

Copy link
Copy Markdown
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.

@slipher slipher left a comment

Copy link
Copy Markdown
Member

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?

Comment thread src/common/CPPStandard.h Outdated
@VReaperV

VReaperV commented Aug 1, 2025

Copy link
Copy Markdown
Contributor Author

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).

@slipher slipher left a comment

Copy link
Copy Markdown
Member

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

Comment thread src/common/math/Vector.h Outdated
Comment thread src/common/math/Vector.h Outdated
Add `CPPStandard.h` for checking C++ features support through feature test macros, replace deprecated `std::result_of` with a custom template.
@slipher

slipher commented Aug 15, 2025

Copy link
Copy Markdown
Member

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