mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-14 06:20:36 +01:00
hull: _cairo_hull_vertex_compare() return 0 for identical elements
Andreas Falkenhahn reported a bizarre situation with some implementations of qsort that actually compare the same elements and require the comparator to return 0. So be it. Reported-by: Andreas Falkenhahn <andreas@airsoftsoftwair.de>
This commit is contained in:
parent
d95037db99
commit
8afd4e4c3d
1 changed files with 7 additions and 0 deletions
|
|
@ -95,6 +95,13 @@ _cairo_hull_vertex_compare (const void *av, const void *bv)
|
|||
cairo_hull_t *b = (cairo_hull_t *) bv;
|
||||
int ret;
|
||||
|
||||
/* Some libraries are reported to actually compare identical
|
||||
* pointers and require the result to be 0. This is the crazy world we
|
||||
* have to live in.
|
||||
*/
|
||||
if (a == b)
|
||||
return 0;
|
||||
|
||||
ret = _cairo_slope_compare (&a->slope, &b->slope);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue