Compile against C++23

This enables some new goodies like std::expected.

A change was needed in the mod loader code because of *something* to do with unique_ptr on an incomplete type. An overload fixed it, I've learned to stop asking questions about C++
This commit is contained in:
Pieter-Jan Briers
2026-10-07 17:26:07 +02:00
parent 2c4960dcdf
commit 593ecd0591
5 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ if(APPLE AND NOT CMAKE_OSX_SYSROOT)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include <bit>
#include <type_traits>
#include "dolphin/types.h"
#include "dolphin/mtx.h"
+1 -1
View File
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.25)
project(custom_actor_demo CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(DUSK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE PATH "Path to dusk source root")
+3 -1
View File
@@ -347,7 +347,9 @@ private:
bool m_startupComplete = false;
LoadedMod* try_load_mod(const std::filesystem::path& modPath, bool fromDir,
uint32_t searchDirIndex, std::unique_ptr<ModBundle> bundle = {});
uint32_t searchDirIndex);
LoadedMod* try_load_mod(const std::filesystem::path& modPath, bool fromDir,
uint32_t searchDirIndex, std::unique_ptr<ModBundle> bundle);
void load_native(LoadedMod& mod, const std::string& dllEntry,
const std::vector<std::string>& runtimeEntries);
bool load_native_if_present(LoadedMod& mod);
+3
View File
@@ -132,6 +132,9 @@ static void warn_unpublished_deferred_exports(const LoadedMod& mod) {
}
}
}
LoadedMod* ModLoader::try_load_mod(const fs::path& modPath, bool fromDir, uint32_t searchDirIndex) {
return try_load_mod(modPath, fromDir, searchDirIndex, {});
}
LoadedMod* ModLoader::try_load_mod(const fs::path& modPath, bool fromDir, uint32_t searchDirIndex,
std::unique_ptr<ModBundle> bundle) {