[+] AuEndianNormalizeLittle

[+] AuEndianNormalizeBig
[+] Missing optional check for Aurora Interfaces
This commit is contained in:
Reece Wilson 2023-01-29 18:54:10 +00:00
parent 165bb0c6e5
commit ecc13f0349
2 changed files with 33 additions and 2 deletions

View File

@ -7,7 +7,7 @@
***/
#pragma once
#include <AuroraEnvironment.h>
#include <AuroraEnvironment.h> // **!
#include <AuroraTypes.hpp>
// BUG: https://developercommunity.visualstudio.com/t/lambdas-always-have-debug-information-in-release-m/1215001
@ -50,12 +50,17 @@
#endif
#endif
// Special include order fuckery ahead of all else for early ForEach under AuroraEnvironment.hpp (starting with **!)
#if defined(_AUHAS_AURORAENUM)
#include <AuroraForEach.hpp>
#include <AuroraInterfaces.hpp>
#include <AuroraEnum.hpp>
#endif
#if defined(_AUHAS_AURORAINTERFACES)
#include <AuroraForEach.hpp>
#include <AuroraInterfaces.hpp>
#endif
#if defined(_AUHAS_FMT)
#include <fmt/format.h>
#endif

View File

@ -92,3 +92,29 @@ inline auline Type_t AuFlipEndian(Type_t in)
{
return AuEndianUtils<Type_t>::Swap(in);
}
template <class Type_t>
inline auline Type_t AuEndianFlip(Type_t in)
{
return AuEndianUtils<Type_t>::Swap(in);
}
template <class Type_t>
inline auline Type_t AuEndianNormalizeLittle(Type_t in)
{
#if defined(AU_CPU_ENDIAN_LITTLE)
return (in);
#else
return AuFlipEndian(in);
#endif
}
template <class Type_t>
inline auline Type_t AuEndianNormalizeBig(Type_t in)
{
#if defined(AU_CPU_ENDIAN_LITTLE)
return AuFlipEndian(in);
#else
return (in);
#endif
}