add LE_{type}

This commit is contained in:
Ced2911 2013-08-16 14:17:39 +02:00
parent c332a4af58
commit c7a294d7c8

View File

@ -169,7 +169,7 @@ private:
# elif defined __SSE3__
# define _M_SSE 0x300
# endif
#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
#elif ((_MSC_VER >= 1500) || __INTEL_COMPILER) // Visual Studio 2008
# define _M_SSE 0x402
#endif
@ -213,6 +213,34 @@ inline double bswapd( double f )
return dat2.f;
}
#ifdef BIG_ENDIAN
template<typename T> T LE_F(T x) {
return (T)bswapf(x);
}
template<typename T> T LE_16(T x) {
return (T)bswap16(x);
}
template<typename T> T LE_32(T x) {
return (T)bswap32(x);
}
template<typename T> T LE_64(T x) {
return (T)bswap64(x);
}
#else
template<typename T> T LE_F(T x) {
return (T)(x);
}
template<typename T> T LE_16(T x) {
return (T)(x);
}
template<typename T> T LE_32(T x) {
return (T)(x);
}
template<typename T> T LE_64(T x) {
return (T)(x);
}
#endif
// Host communication.
enum HOST_COMM
{