diff --git a/styles/tests.cpp b/styles/tests.cpp index b005b0867..e0611d7af 100644 --- a/styles/tests.cpp +++ b/styles/tests.cpp @@ -17,6 +17,11 @@ float fract(float x) { return x - floor(x); } uint32_t micros_ = 0; uint32_t micros() { return micros_; } +int32_t clampi32(int32_t x, int32_t a, int32_t b) { + if (x < a) return a; + if (x > b) return b; + return x; +} // This really ought to be a typedef, but it causes problems I don't understand. #define StyleAllocator class StyleFactory*