1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-04 00:23:25 +08:00

Fix namespace clash with libstdc++-4.9.

This commit is contained in:
David Anderson 2020-05-18 15:52:13 -07:00
parent 9b2dbfd1d0
commit 13499e5c3a
5 changed files with 21 additions and 21 deletions

View File

@ -1658,9 +1658,9 @@ void MatrixInvert( const matrix3x4_t& in, matrix3x4_t& out )
Assert( s_bMathlibInitialized );
if ( &in == &out )
{
swap(out[0][1],out[1][0]);
swap(out[0][2],out[2][0]);
swap(out[1][2],out[2][1]);
valve_swap(out[0][1],out[1][0]);
valve_swap(out[0][2],out[2][0]);
valve_swap(out[1][2],out[2][1]);
}
else
{
@ -3282,18 +3282,18 @@ bool SolveInverseQuadraticMonotonic( float x1, float y1, float x2, float y2, flo
// first, sort parameters
if (x1>x2)
{
swap(x1,x2);
swap(y1,y2);
valve_swap(x1,x2);
valve_swap(y1,y2);
}
if (x2>x3)
{
swap(x2,x3);
swap(y2,y3);
valve_swap(x2,x3);
valve_swap(y2,y3);
}
if (x1>x2)
{
swap(x1,x2);
swap(y1,y2);
valve_swap(x1,x2);
valve_swap(y1,y2);
}
// this code is not fast. what it does is when the curve would be non-monotonic, slowly shifts
// the center point closer to the linear line between the endpoints. Should anyone need htis

View File

@ -581,7 +581,7 @@ template<> FORCEINLINE_TEMPLATE QAngleByValue Lerp<QAngleByValue>( float flPerce
// Swap two of anything.
template <class T>
FORCEINLINE_TEMPLATE void swap( T& x, T& y )
FORCEINLINE_TEMPLATE void valve_swap( T& x, T& y )
{
T temp = x;
x = y;

View File

@ -228,9 +228,9 @@ CUtlMemory<T>::~CUtlMemory()
template< class T >
void CUtlMemory<T>::Swap( CUtlMemory< T > &mem )
{
swap( m_nGrowSize, mem.m_nGrowSize );
swap( m_pMemory, mem.m_pMemory );
swap( m_nAllocationCount, mem.m_nAllocationCount );
valve_swap( m_nGrowSize, mem.m_nGrowSize );
valve_swap( m_pMemory, mem.m_pMemory );
valve_swap( m_nAllocationCount, mem.m_nAllocationCount );
}

View File

@ -1400,12 +1400,12 @@ template <class T, class I, typename L>
void CUtlRBTree<T, I, L>::Swap( CUtlRBTree< T, I, L > &that )
{
m_Elements.Swap( that.m_Elements );
swap( m_LessFunc, that.m_LessFunc );
swap( m_Root, that.m_Root );
swap( m_NumElements, that.m_NumElements );
swap( m_FirstFree, that.m_FirstFree );
swap( m_TotalElements, that.m_TotalElements );
swap( m_pElements, that.m_pElements );
valve_swap( m_LessFunc, that.m_LessFunc );
valve_swap( m_Root, that.m_Root );
valve_swap( m_NumElements, that.m_NumElements );
valve_swap( m_FirstFree, that.m_FirstFree );
valve_swap( m_TotalElements, that.m_TotalElements );
valve_swap( m_pElements, that.m_pElements );
}

View File

@ -508,8 +508,8 @@ template< typename T, class A >
void CUtlVector<T, A>::Swap( CUtlVector< T, A > &vec )
{
m_Memory.Swap( vec.m_Memory );
swap( m_Size, vec.m_Size );
swap( m_pElements, vec.m_pElements );
valve_swap( m_Size, vec.m_Size );
valve_swap( m_pElements, vec.m_pElements );
}
template< typename T, class A >