diff options
| author | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
| commit | 61e5bcef2629e2d68b805a956a96fff264d4f74d (patch) | |
| tree | bca3a94bac79d34e3c0db57c77604f5a823ecbda /core/floathacks.hh | |
| parent | 88c01588aa0830e219eaa62588839e4d1e2883ce (diff) | |
| download | voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.tar.bz2 voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.zip | |
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)
Diffstat (limited to 'core/floathacks.hh')
| -rw-r--r-- | core/floathacks.hh | 11 |
1 files changed, 3 insertions, 8 deletions
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<float>::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<float>::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<float>::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<float>::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<float>::is_iec559);
- static_assert(sizeof(std::uint32_t) == sizeof(float));
union {
float src;
std::uint32_t dst;
|
