From 61e5bcef2629e2d68b805a956a96fff264d4f74d Mon Sep 17 00:00:00 2001 From: untodesu Date: Sat, 28 Jun 2025 01:59:49 +0500 Subject: Restructure dependencies and update to C++20 - Nuked static_assert from almost everywhere in the project - Nuked binary dependency support. Might add one later though - Separated dependency headers into a separate include subdirectory - Grafted a thirdpartylegalnotices.txt generator from RITEG - Pushed development snapshot version to 2126 (26th week of 2025) --- core/floathacks.hh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'core/floathacks.hh') diff --git a/core/floathacks.hh b/core/floathacks.hh index 0796b10..31915c8 100644 --- a/core/floathacks.hh +++ b/core/floathacks.hh @@ -10,10 +10,11 @@ static inline std::int32_t float_to_int32(const float value); static inline std::uint32_t float_to_uint32(const float value); } // namespace floathacks +static_assert(std::numeric_limits::is_iec559, "Floathacks only works with IEEE 754 compliant floats"); +static_assert(sizeof(std::int32_t) == sizeof(float), "Floathacks requires 32-bit integers to match float size"); + static inline float floathacks::int32_to_float(const std::int32_t value) { - static_assert(std::numeric_limits::is_iec559); - static_assert(sizeof(std::int32_t) == sizeof(float)); union { std::int32_t src; float dst; @@ -24,8 +25,6 @@ static inline float floathacks::int32_to_float(const std::int32_t value) static inline float floathacks::uint32_to_float(const std::uint32_t value) { - static_assert(std::numeric_limits::is_iec559); - static_assert(sizeof(std::uint32_t) == sizeof(float)); union { std::uint32_t src; float dst; @@ -36,8 +35,6 @@ static inline float floathacks::uint32_to_float(const std::uint32_t value) static inline std::int32_t floathacks::float_to_int32(const float value) { - static_assert(std::numeric_limits::is_iec559); - static_assert(sizeof(std::int32_t) == sizeof(float)); union { float src; std::int32_t dst; @@ -48,8 +45,6 @@ static inline std::int32_t floathacks::float_to_int32(const float value) static inline std::uint32_t floathacks::float_to_uint32(const float value) { - static_assert(std::numeric_limits::is_iec559); - static_assert(sizeof(std::uint32_t) == sizeof(float)); union { float src; std::uint32_t dst; -- cgit