bug 603879 - part 1.1 - work around gcc4.3/opt compile failure in harfbuzz code. a=bustage
--- a/gfx/harfbuzz/src/hb-open-type-private.hh
+++ b/gfx/harfbuzz/src/hb-open-type-private.hh
@@ -700,28 +700,36 @@ struct HeadlessArrayOf
}
USHORT len;
Type array[VAR];
public:
DEFINE_SIZE_ARRAY (sizeof (USHORT), array);
};
+#if __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
+// work around GCC 4.3 bug where the search() function gets improperly
+// optimized away from some instantiations of this template
+#pragma GCC visibility push(default)
+#endif
/* An array with sorted elements. Supports binary searching. */
template <typename Type>
struct SortedArrayOf : ArrayOf<Type> {
template <typename SearchType>
inline int search (const SearchType &x) const {
class Cmp {
public: static int cmp (const SearchType *a, const Type *b) { return b->cmp (*a); }
};
const Type *p = (const Type *) bsearch (&x, this->array, this->len, sizeof (this->array[0]), (hb_compare_func_t) Cmp::cmp);
return p ? p - this->array : -1;
}
};
+#if __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
+#pragma GCC visibility pop
+#endif
HB_BEGIN_DECLS
HB_END_DECLS
#endif /* HB_OPEN_TYPE_PRIVATE_HH */