diff --git a/src/hb-algs.hh b/src/hb-algs.hh index b053923df..fc6ba15d5 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -150,6 +150,12 @@ struct BEInt private: uint8_t v[4]; }; +/* Floats. */ + +/* We want our rounding towards +infinity. */ +static inline float +_hb_roundf (float x) { return floorf (x + .5f); } +#define roundf(x) _hb_roundf(x) /* Encodes three unsigned integers in one 64-bit number. If the inputs have more than 21 bits, @@ -165,6 +171,7 @@ struct BEInt #define HB_CODEPOINT_DECODE3_11_7_14_2(v) ((hb_codepoint_t) (((v) >> 14) & 0x007Fu) | 0x0300) #define HB_CODEPOINT_DECODE3_11_7_14_3(v) ((hb_codepoint_t) (v) & 0x3FFFu) + struct { /* Note. This is dangerous in that if it's passed an rvalue, it returns rvalue-reference. */ diff --git a/src/hb.hh b/src/hb.hh index 5915e2819..0033215a4 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -448,11 +448,6 @@ static_assert ((sizeof (hb_mask_t) == 4), ""); static_assert ((sizeof (hb_var_int_t) == 4), ""); -static inline float -_hb_roundf (float x) { return floorf (x + .5f); } -#define roundf(x) _hb_roundf(x) - - /* * For lack of a better place, put Zawgyi script hack here. * https://github.com/harfbuzz/harfbuzz/issues/1162