Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .teamcity/Windows/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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%%']
Expand Down
18 changes: 9 additions & 9 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand All @@ -70,35 +70,35 @@
"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"
}
},
{
"name": "x64-windows-release",
"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"
}
},
{
"name": "x64-windows-debug",
"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"
}
},
{
"name": "x64-windows-trinitydev",
"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"
}
},
{
Expand Down
92 changes: 0 additions & 92 deletions include/CcpAtomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,98 +28,6 @@
#include <atomic>
#define CcpAtomic std::atomic

#else

#ifdef _WIN32

template <typename T>
class CcpAtomic
{};

template <>
class CcpAtomic<uint32_t>
{
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<uint32_t*>( &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
1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ enable_testing()

find_package(GTest CONFIG REQUIRED)
add_executable(CcpCoreTest
CcpAtomic.cpp
CCPCallstack.cpp
CcpCoreTest.cpp
CCPHash.cpp
Expand Down
97 changes: 0 additions & 97 deletions tests/CcpAtomic.cpp

This file was deleted.