From d3b7e0e080c987f671642b302563012e9c7acf2d Mon Sep 17 00:00:00 2001 From: CCP Toebeans <105929497+ccptoebeans@users.noreply.github.com> Date: Tue, 10 Mar 2026 10:19:51 +0000 Subject: [PATCH 1/4] Revert "Revert "Add presets for compilation with v145 toolchain on windows"" --- CMakePresets.json | 18 +++++++++--------- vendor/github.com/carbonengine/vcpkg-registry | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 9e1818f..9765ff5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -43,7 +43,7 @@ "name": "x64-windows", "inherits": "windows", "cacheVariables": { - "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vendor/github.com/carbonengine/vcpkg-registry/toolchains/x64-windows-carbon.cmake" + "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vendor/github.com/carbonengine/vcpkg-registry/toolchains/x64-windows-145-carbon.cmake" }, "hidden": true }, @@ -70,8 +70,8 @@ "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "Internal", - "VCPKG_TARGET_TRIPLET": "x64-windows-internal", - "VCPKG_HOST_TRIPLET": "x64-windows-internal" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-internal", + "VCPKG_HOST_TRIPLET": "x64-windows-145-internal" } }, { @@ -79,8 +79,8 @@ "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "VCPKG_TARGET_TRIPLET": "x64-windows-release", - "VCPKG_HOST_TRIPLET": "x64-windows-release" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-release", + "VCPKG_HOST_TRIPLET": "x64-windows-145-release" } }, { @@ -88,8 +88,8 @@ "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "VCPKG_TARGET_TRIPLET": "x64-windows-debug", - "VCPKG_HOST_TRIPLET": "x64-windows-debug" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-debug", + "VCPKG_HOST_TRIPLET": "x64-windows-145-debug" } }, { @@ -97,8 +97,8 @@ "inherits": "x64-windows", "cacheVariables": { "CMAKE_BUILD_TYPE": "TrinityDev", - "VCPKG_TARGET_TRIPLET": "x64-windows-trinitydev", - "VCPKG_HOST_TRIPLET": "x64-windows-trinitydev" + "VCPKG_TARGET_TRIPLET": "x64-windows-145-trinitydev", + "VCPKG_HOST_TRIPLET": "x64-windows-145-trinitydev" } }, { diff --git a/vendor/github.com/carbonengine/vcpkg-registry b/vendor/github.com/carbonengine/vcpkg-registry index de86dca..045c6bc 160000 --- a/vendor/github.com/carbonengine/vcpkg-registry +++ b/vendor/github.com/carbonengine/vcpkg-registry @@ -1 +1 @@ -Subproject commit de86dcad60458ef170911adb5c42a053fc5d9117 +Subproject commit 045c6bca667e8de2ba59d08d6dafdb86a4feaa60 From ac86a8dcad5026cc7e6911632144057ce59cab44 Mon Sep 17 00:00:00 2001 From: Ccp Toebeans Date: Tue, 10 Mar 2026 11:48:01 +0000 Subject: [PATCH 2/4] Activate newest visual studio installation on build agent for windows builds --- .teamcity/Windows/Project.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.teamcity/Windows/Project.kt b/.teamcity/Windows/Project.kt index f79608a..9164a47 100644 --- a/.teamcity/Windows/Project.kt +++ b/.teamcity/Windows/Project.kt @@ -89,7 +89,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String) scriptContent = """ REM unfortunately ninja does not find the VS environment otherwise REM NB: the exported PATH also contains the location where we installed sentry-cli, e.g. teamcity.agent.work.dir - call "%%ProgramFiles(x86)%%\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\vsdevcmd.bat" -arch=x64 + call "%%ProgramFiles(x86)%%\Microsoft Visual Studio\18\BuildTools\Common7\Tools\vsdevcmd.bat" -arch=x64 echo ##teamcity[setParameter name='env.INCLUDE' value='%%INCLUDE%%'] echo ##teamcity[setParameter name='env.LIB' value='%%LIB%%'] echo ##teamcity[setParameter name='env.LIBPATH' value='%%LIBPATH%%'] From 80a8b53adc47da13b44bebf90b2ec9efd3fbb866 Mon Sep 17 00:00:00 2001 From: Ccp Toebeans Date: Tue, 10 Mar 2026 13:47:14 +0000 Subject: [PATCH 3/4] Remove CcpAtomic.cpp, as we no longer support windows compiler versions so old that we need to implement our own version of std::atomic --- include/CcpAtomic.h | 92 ------------------------------------------ tests/CcpAtomic.cpp | 97 --------------------------------------------- 2 files changed, 189 deletions(-) delete mode 100644 tests/CcpAtomic.cpp diff --git a/include/CcpAtomic.h b/include/CcpAtomic.h index 1f50e94..c050682 100644 --- a/include/CcpAtomic.h +++ b/include/CcpAtomic.h @@ -28,98 +28,6 @@ #include #define CcpAtomic std::atomic -#else - -#ifdef _WIN32 - -template -class CcpAtomic -{}; - -template <> -class CcpAtomic -{ -public: - CcpAtomic() - { - } - - CcpAtomic( uint32_t initialValue ) - { - store( initialValue ); - } - - uint32_t operator=( uint32_t desired ) - { - uint32_t oldValue = InterlockedExchange( &m_value, desired ); - return oldValue; - } - - // Pre-increment - uint32_t operator++() - { - uint32_t oldValue = InterlockedIncrement( &m_value ); - return oldValue; - } - - // Post-increment - uint32_t operator++(int) - { - uint32_t oldValue = InterlockedIncrement( &m_value ); - return oldValue - 1; - } - - // Pre-decrement - uint32_t operator--() - { - uint32_t oldValue = InterlockedDecrement( &m_value ); - return oldValue; - } - - // Post-decrement - uint32_t operator--(int) - { - uint32_t oldValue = InterlockedDecrement( &m_value ); - return oldValue + 1; - } - - operator uint32_t() const - { - uint32_t curValue = InterlockedCompareExchange( const_cast( &m_value ), 0, 0 ); - return curValue; - } - - uint32_t operator+=( uint32_t arg ) - { - uint32_t oldValue = InterlockedExchangeAdd( &m_value, arg ); - return oldValue + arg; - } - - void store( uint32_t val ) - { - InterlockedExchange( &m_value, val ); - } - - bool compare_exchange_strong( uint32_t& expected, uint32_t desired ) - { - auto prev = InterlockedCompareExchange( &m_value, desired, expected ); - if( prev == expected ) - { - return true; - } - expected = prev; - return false; - } - -private: - uint32_t m_value; - -private: - CcpAtomic(const CcpAtomic&); // not defined - CcpAtomic& operator=(const CcpAtomic&); // not defined -}; -#endif - #endif #endif // CcpAtomic_h \ No newline at end of file diff --git a/tests/CcpAtomic.cpp b/tests/CcpAtomic.cpp deleted file mode 100644 index c46416d..0000000 --- a/tests/CcpAtomic.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright © 2025 CCP ehf. - -#include "gtest/gtest.h" -#include "CcpCore.h" - -TEST( CcpAtomicTest, DefaultConstructorDoesNotInitializeContents ) -{ - char buffer[sizeof( CcpAtomic )]; - memset( buffer, 0xaf, sizeof( buffer ) ); - CcpAtomic* a = new( buffer )CcpAtomic; - ASSERT_EQ( 0xafafafaf, uint32_t( *a ) ); -} - -TEST( CcpAtomicTest, CopyConstructorInitializesCorrectly ) -{ - CcpAtomic a( 123 ); - ASSERT_EQ( 123, uint32_t( a ) ); -} - -TEST( CcpAtomicTest, AssignmentStoresValue ) -{ - CcpAtomic a( 123 ); - a = 456; - ASSERT_EQ( 456, uint32_t( a ) ); -} - -TEST( CcpAtomicTest, PreIncrementIncrementsValue ) -{ - CcpAtomic a( 123 ); - ++a; - ASSERT_EQ( 124, uint32_t( a ) ); -} - -TEST( CcpAtomicTest, PreIncrementReturnsIncrementedValue ) -{ - CcpAtomic a( 123 ); - ASSERT_EQ( 124, ++a ); -} - -TEST( CcpAtomicTest, PostIncrementIncrementsValue ) -{ - CcpAtomic a( 123 ); - a++; - ASSERT_EQ( 124, uint32_t( a ) ); -} - -TEST( CcpAtomicTest, PostIncrementReturnsOriginalValue ) -{ - CcpAtomic a( 123 ); - ASSERT_EQ( 123, a++ ); -} - -TEST( CcpAtomicTest, PreDecrementDecrementsValue ) -{ - CcpAtomic a( 123 ); - --a; - ASSERT_EQ( 122, uint32_t( a ) ); -} - -TEST( CcpAtomicTest, PreDecrementReturnsDecrementedValue ) -{ - CcpAtomic a( 123 ); - ASSERT_EQ( 122, --a ); -} - -TEST( CcpAtomicTest, PostDecrementDecrementsValue ) -{ - CcpAtomic a( 123 ); - a--; - ASSERT_EQ( 122, uint32_t( a ) ); -} - -TEST( CcpAtomicTest, PostDecrementReturnsOriginalValue ) -{ - CcpAtomic a( 123 ); - ASSERT_EQ( 123, a-- ); -} - -TEST( CcpAtomicTest, AssignmentWithAddIncrementsValue ) -{ - CcpAtomic a( 123 ); - a += 111; - ASSERT_EQ( 234, a ); -} - -TEST( CcpAtomicTest, AssignmentWithAddReturnsIncrementedValue ) -{ - CcpAtomic a( 123 ); - ASSERT_EQ( 234, a += 111 ); -} - -TEST( CcpAtomicTest, StoreStoresValue ) -{ - CcpAtomic a( 123 ); - a.store( 456 ); - ASSERT_EQ( 456, uint32_t( a ) ); -} From 15caa4ff60b6898635a4e7fe001159337fd594a0 Mon Sep 17 00:00:00 2001 From: Ccp Toebeans Date: Tue, 10 Mar 2026 13:53:57 +0000 Subject: [PATCH 4/4] Remove CcpAtomic.ccp listing from tests/CMakeLists.txt --- tests/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e6bc47a..2e848e1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,6 @@ enable_testing() find_package(GTest CONFIG REQUIRED) add_executable(CcpCoreTest - CcpAtomic.cpp CCPCallstack.cpp CcpCoreTest.cpp CCPHash.cpp