Core/Endianness: Add SwapBytes shortcut

Former-commit-id: c345121453f38c9eb8c05e224db91f068440f729
This commit is contained in:
Lynix
2016-04-21 13:20:46 +02:00
parent 0d75f8ab2e
commit 3caeb91a32
2 changed files with 12 additions and 6 deletions

View File

@@ -11,7 +11,7 @@
#include <Nazara/Core/Enums.hpp>
#if !defined(NAZARA_BIG_ENDIAN) && !defined(NAZARA_LITTLE_ENDIAN)
// Automatic detection following macroes of compiler
// Automatic detection following macros of compiler
#if defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || (defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || defined(__sparc__) || defined(__hppa__)
#define NAZARA_BIG_ENDIAN
@@ -28,7 +28,8 @@
namespace Nz
{
inline constexpr Endianness GetPlatformEndianness();
inline void SwapBytes(void* buffer, unsigned int size);
inline void SwapBytes(void* buffer, std::size_t size);
template<typename T> T SwapBytes(T value);
}
#include <Nazara/Core/Endianness.inl>