Just about at the end of TA3D_Platform.h you have a number of functions that u stripped off the 'T' exteion, as well you used min/max functions under everything but windows, which boggles my mind since macro here would clearly be superior. Also the other template functions should be usueful in later builds and you might wana retain them. Your code looks something similar to this, to which I already fixed it to compile under my compiler...
Code: Select all
#ifdef TA3D_PLATFORM_WINDOWS
// Min/max macros.
// Normally #defined by a Win32 header file
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
template<class T> static void Swap (T &a, T &b)
{
T temp;
temp = a;
a = b;
b = temp;
return;
}
// bit field mask operation macros
template<class T> static void SetMask (T &var, T &mask)
{
var |= mask;
return;
}
template<class T> static void UnsetMask (T &var, T &mask)
{
var |= ~mask;
return;
}
// ordinal bit manipulation macros (least significant bit = bit "0")
template<class T> static T Bit (T &bit)
{
return (1 << bit);
}
template<class T> static void SetBit (T &var, T &bit)
{
return (SetMask (var, Bit(bit)));
}
template<class T> static void UnsetBit (T &var, T &bit)
{
return (UnsetMask (var, Bit(bit)));
}
// Returns -1/1/0 for sign of a variable
template<class T> static T Sign (T x)
{
if (x > 0)
return (1);
else
if ( x < 0)
return (-1);
//else
return (0);
}
#else
inline int min(int a,int b)
{
return (a<b ? a : b);
}
inline float min(float a,float b)
{
return (a<b ? a : b);
}
inline int max(int a,int b)
{
return (a<b ? b : a);
}
inline float max(float a,float b)
{
return (a<b ? b : a);
}
#endif
Code: Select all
// Min/max macros.
// Normally #defined by a Win32 header file
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
template<class T> static void Swap (T &a, T &b)
{
T temp;
temp = a;
a = b;
b = temp;
return;
}
// bit field mask operation macros
template<class T> static void SetMask (T &var, T &mask)
{
var |= mask;
return;
}
template<class T> static void UnsetMask (T &var, T &mask)
{
var |= ~mask;
return;
}
// ordinal bit manipulation macros (least significant bit = bit "0")
template<class T> static T Bit (T &bit)
{
return (1 << bit);
}
template<class T> static void SetBit (T &var, T &bit)
{
return (SetMask (var, Bit(bit)));
}
template<class T> static void UnsetBit (T &var, T &bit)
{
return (UnsetMask (var, Bit(bit)));
}
// Returns -1/1/0 for sign of a variable
template<class T> static T Sign (T x)
{
if (x > 0)
return (1);
else
if ( x < 0)
return (-1);
//else
return (0);
}
Code: Select all
template<class T> static inline T max( T a, T b )
{
return ( ((a) > (b)) ? a : b );
}
template<class T> static inline T min( T a, T b )
{
return ( ((a) < (b)) ? a : b );
}
++Cire.