More changes to the cSTLAllocator for mac os x compatibility.
This commit is contained in:
parent
dfef14e5f7
commit
f7bbd9f0f9
|
@ -36,17 +36,17 @@ namespace cAudio
|
|||
typedef cSTLAllocator<U> other;
|
||||
};
|
||||
|
||||
inline explicit cSTLAllocator()
|
||||
cSTLAllocator()
|
||||
{ }
|
||||
|
||||
virtual ~cSTLAllocator()
|
||||
~cSTLAllocator() throw()
|
||||
{ }
|
||||
|
||||
inline cSTLAllocator( cSTLAllocator const& )
|
||||
cSTLAllocator( const cSTLAllocator& ) throw()
|
||||
{ }
|
||||
|
||||
template <typename U>
|
||||
inline cSTLAllocator( cSTLAllocator<U> const& )
|
||||
cSTLAllocator( const cSTLAllocator<U>& ) throw()
|
||||
{ }
|
||||
|
||||
pointer address(reference x) const
|
||||
|
@ -89,14 +89,30 @@ namespace cAudio
|
|||
}
|
||||
};
|
||||
|
||||
template <typename T1, typename T2>
|
||||
bool operator==(const cSTLAllocator<T1>&, const cSTLAllocator<T2>&)
|
||||
template<> class cSTLAllocator<void>
|
||||
{
|
||||
public:
|
||||
typedef size_t size_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef void* pointer;
|
||||
typedef const void* const_pointer;
|
||||
typedef void value_type;
|
||||
|
||||
template<typename U>
|
||||
struct rebind
|
||||
{
|
||||
typedef cSTLAllocator<U> other;
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline bool operator==(const cSTLAllocator<T>&, const cSTLAllocator<T>&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
bool operator!=(const cSTLAllocator<T1>&, const cSTLAllocator<T2>&)
|
||||
template <typename T>
|
||||
inline bool operator!=(const cSTLAllocator<T>&, const cSTLAllocator<T>&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace cAudio
|
|||
//! Smallest number that can be represented with a 32 bit float (may not match your compiler/os varient)
|
||||
const float Epsilon = 0.000001f;
|
||||
|
||||
//! Internal function that compared two floats while keeping the Epsilon in mind.
|
||||
//! Internal function that compares two floats while keeping the Epsilon in mind.
|
||||
inline bool float_equals(const float a, const float b)
|
||||
{
|
||||
return (a + Epsilon >= b) && (a - Epsilon <= b);
|
||||
|
|
Loading…
Reference in New Issue