From 53cbaa4c8becd116707ca862501eb787f76edf1a Mon Sep 17 00:00:00 2001 From: nishinji Date: Wed, 6 Aug 2025 18:13:36 +0900 Subject: [PATCH] vita3k: Switch to C++23 --- .clang-format | 4 ++-- .github/format-check.sh | 2 +- CMakeLists.txt | 2 +- external/CppCommon/source/cpu.cpp | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.clang-format b/.clang-format index 005c1c8e9..ced6a2223 100644 --- a/.clang-format +++ b/.clang-format @@ -20,7 +20,7 @@ AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: false BinPackArguments: true BinPackParameters: true -BraceWrapping: +BraceWrapping: AfterClass: false AfterControlStatement: false AfterEnum: false @@ -52,7 +52,7 @@ DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] -IncludeCategories: +IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|isl|json)/)' diff --git a/.github/format-check.sh b/.github/format-check.sh index f11fbb089..e9bd2d677 100755 --- a/.github/format-check.sh +++ b/.github/format-check.sh @@ -2,7 +2,7 @@ set -ex -if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then +if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then git fetch origin $GITHUB_BASE_REF:refs/remotes/origin/$GITHUB_BASE_REF for f in $(git diff --diff-filter=AM --name-only origin/$GITHUB_BASE_REF 'vita3k/**.cpp' 'vita3k/**.h' 'tools/**.cpp' 'tools/**.h'); do if [ "$(diff -u <(cat $f) <(clang-format $f))" != "" ] diff --git a/CMakeLists.txt b/CMakeLists.txt index 92849e814..44ab21220 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ ProcessorCount(CPU_COUNT) # Define the Architecture variable, right now it should only contain "x86_64" or "arm64" include("external/dynarmic/CMakeModules/DetectArchitecture.cmake") -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) diff --git a/external/CppCommon/source/cpu.cpp b/external/CppCommon/source/cpu.cpp index 5befc99f1..1ee5d7654 100644 --- a/external/CppCommon/source/cpu.cpp +++ b/external/CppCommon/source/cpu.cpp @@ -16,6 +16,7 @@ #include #include #elif defined(_WIN32) || defined(_WIN64) +#include #include #endif