FOSS-VG/src/lib/nbt.cpp

23 lines
508 B
C++

#include <bit>
// This is just an example for how to find out if the system is big endian or little endian. Do not use this.
int endianness_example() {
if constexpr (std::endian::native == std::endian::big)
{
// Big-endian system
return 0;
}
else if constexpr (std::endian::native == std::endian::little)
{
// Little-endian system
return 1;
}
else
{
// Something else
return 2;
// How did we even end up here?
}
}