Browse Source

Fix math::normalizeZero() for clang.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
228941c72b
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      include/math.hpp

+ 5
- 0
include/math.hpp View File

@@ -118,7 +118,12 @@ inline float clampSafe(float x, float a = 0.f, float b = 1.f) {
} }


/** Converts -0.f to 0.f. Leaves all other values unchanged. */ /** Converts -0.f to 0.f. Leaves all other values unchanged. */
#if defined __clang__
// Clang doesn't support disabling individual optimizations, just everything.
__attribute__((optnone))
#else
__attribute__((optimize("signed-zeros"))) __attribute__((optimize("signed-zeros")))
#endif
inline float normalizeZero(float x) { inline float normalizeZero(float x) {
return x + 0.f; return x + 0.f;
} }


Loading…
Cancel
Save