Removes bits of code and includes that are based on old 360, xbox and PS3 flags that are no longer needed.

This commit is contained in:
Areloch 2017-04-08 20:30:57 -05:00
parent b052a1f970
commit ed14b6fced
43 changed files with 35 additions and 356 deletions

View file

@ -28,8 +28,6 @@
#ifdef TORQUE_OS_MAC
#include <libkern/OSAtomic.h>
#elif defined(TORQUE_OS_PS3)
#include <cell/atomic.h>
#endif
// Fetch-And-Add
@ -39,9 +37,7 @@
//
inline void dFetchAndAdd( volatile U32& ref, U32 val )
{
#if defined(TORQUE_OS_PS3)
cellAtomicAdd32( (std::uint32_t *)&ref, val );
#elif !defined(TORQUE_OS_MAC)
#if !defined(TORQUE_OS_MAC)
__sync_fetch_and_add(&ref, val );
#else
OSAtomicAdd32( val, (int32_t* ) &ref);
@ -50,9 +46,7 @@ inline void dFetchAndAdd( volatile U32& ref, U32 val )
inline void dFetchAndAdd( volatile S32& ref, S32 val )
{
#if defined(TORQUE_OS_PS3)
cellAtomicAdd32( (std::uint32_t *)&ref, val );
#elif !defined(TORQUE_OS_MAC)
#if !defined(TORQUE_OS_MAC)
__sync_fetch_and_add( &ref, val );
#else
OSAtomicAdd32( val, (int32_t* ) &ref);
@ -65,9 +59,7 @@ inline bool dCompareAndSwap( volatile U32& ref, U32 oldVal, U32 newVal )
{
// bool
//OSAtomicCompareAndSwap32(int32_t oldValue, int32_t newValue, volatile int32_t *theValue);
#if defined(TORQUE_OS_PS3)
return ( cellAtomicCompareAndSwap32( (std::uint32_t *)&ref, newVal, oldVal ) == oldVal );
#elif !defined(TORQUE_OS_MAC)
#if !defined(TORQUE_OS_MAC)
return ( __sync_val_compare_and_swap( &ref, oldVal, newVal ) == oldVal );
#else
return OSAtomicCompareAndSwap32(oldVal, newVal, (int32_t *) &ref);
@ -76,22 +68,17 @@ inline bool dCompareAndSwap( volatile U32& ref, U32 oldVal, U32 newVal )
inline bool dCompareAndSwap( volatile U64& ref, U64 oldVal, U64 newVal )
{
#if defined(TORQUE_OS_PS3)
return ( cellAtomicCompareAndSwap32( (std::uint32_t *)&ref, newVal, oldVal ) == oldVal );
#elif !defined(TORQUE_OS_MAC)
#if !defined(TORQUE_OS_MAC)
return ( __sync_val_compare_and_swap( &ref, oldVal, newVal ) == oldVal );
#else
return OSAtomicCompareAndSwap64(oldVal, newVal, (int64_t *) &ref);
#endif
}
/// Performs an atomic read operation.
inline U32 dAtomicRead( volatile U32 &ref )
{
#if defined(TORQUE_OS_PS3)
return cellAtomicAdd32( (std::uint32_t *)&ref, 0 );
#elif !defined(TORQUE_OS_MAC)
#if !defined(TORQUE_OS_MAC)
return __sync_fetch_and_add( ( volatile long* ) &ref, 0 );
#else
return OSAtomicAdd32( 0, (int32_t* ) &ref);