1#ifndef SDL3PP_ENDIAN_H_
2#define SDL3PP_ENDIAN_H_
4#include <SDL3/SDL_endian.h>
5#include "SDL3pp_stdinc.h"
49#define SDL_LIL_ENDIAN 1234
68#define SDL_BIG_ENDIAN 4321
88#define SDL_BYTEORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
108#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
131constexpr float SwapFloat(
float x) {
return SDL_SwapFloat(x); }
152constexpr Uint16
Swap16(Uint16 x) {
return SDL_Swap16(x); }
173constexpr Uint32
Swap32(Uint32 x) {
return SDL_Swap32(x); }
194constexpr Uint32
Swap64(Uint64 x) {
return SDL_Swap64(x); }
210constexpr Uint16
Swap16LE(Uint16 x) {
return SDL_Swap16LE(x); }
226constexpr Uint32
Swap32LE(Uint32 x) {
return SDL_Swap32LE(x); }
242constexpr Uint64
Swap64LE(Uint64 x) {
return SDL_Swap64LE(x); }
258constexpr float SwapFloatLE(
float x) {
return SDL_SwapFloatLE(x); }
274constexpr Uint16
Swap16BE(Uint16 x) {
return SDL_Swap16BE(x); }
290constexpr Uint32
Swap32BE(Uint32 x) {
return SDL_Swap32BE(x); }
306constexpr Uint64
Swap64BE(Uint64 x) {
return SDL_Swap64BE(x); }
322constexpr float SwapFloatBE(
float x) {
return SDL_SwapFloatBE(x); }
constexpr Uint16 Swap16(Uint16 x)
Byte-swap an unsigned 16-bit number.
Definition SDL3pp_endian.h:152
constexpr Uint16 Swap16BE(Uint16 x)
Swap a 16-bit value from bigendian to native byte order.
Definition SDL3pp_endian.h:274
constexpr Uint64 Swap64LE(Uint64 x)
Swap a 64-bit value from littleendian to native byte order.
Definition SDL3pp_endian.h:242
constexpr Uint64 Swap64BE(Uint64 x)
Swap a 64-bit value from bigendian to native byte order.
Definition SDL3pp_endian.h:306
constexpr float SwapFloatBE(float x)
Swap a floating point value from bigendian to native byte order.
Definition SDL3pp_endian.h:322
constexpr float SwapFloatLE(float x)
Swap a floating point value from littleendian to native byte order.
Definition SDL3pp_endian.h:258
constexpr Uint32 Swap32(Uint32 x)
Byte-swap an unsigned 32-bit number.
Definition SDL3pp_endian.h:173
constexpr Uint32 Swap32BE(Uint32 x)
Swap a 32-bit value from bigendian to native byte order.
Definition SDL3pp_endian.h:290
constexpr float SwapFloat(float x)
Byte-swap a floating point number.
Definition SDL3pp_endian.h:131
constexpr Uint32 Swap32LE(Uint32 x)
Swap a 32-bit value from littleendian to native byte order.
Definition SDL3pp_endian.h:226
constexpr Uint32 Swap64(Uint64 x)
Byte-swap an unsigned 64-bit number.
Definition SDL3pp_endian.h:194
constexpr Uint16 Swap16LE(Uint16 x)
Swap a 16-bit value from littleendian to native byte order.
Definition SDL3pp_endian.h:210
the main namespace where all SDL3pp public functions and types live
Definition SDL3pp_assert.h:7