From c9cb051fae190acfc36813e4a23759fb9b9c3df3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 16 Nov 2020 12:48:44 +0100 Subject: Implement hierarchical evaluation (WIP) --- minicc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'minicc.cpp') diff --git a/minicc.cpp b/minicc.cpp index 2e9c215..a843254 100644 --- a/minicc.cpp +++ b/minicc.cpp @@ -4,6 +4,7 @@ #include "minicc.h" #include +#include #include #include @@ -65,3 +66,15 @@ std::string demangle(const std::type_info& type) return boost::core::demangle(type.name()); } +std::vector to_little_endian(uint32_t value) +{ + std::vector result(size_t(4)); + *(reinterpret_cast(result.data())) = boost::endian::native_to_little(value); + return result; +} + +uint32_t from_little_endian(const std::vector& value) +{ + return boost::endian::little_to_native(*(reinterpret_cast(value.data()))); +} + -- cgit v1.2.3