[PATCH] Compile with old compilers

Peter O'Gorman pogma at thewrittenword.com
Fri Aug 15 12:46:22 PDT 2008


Some compilers fail to compile non-constant struct initializers.
---
 src/cairo-clip.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 8a7c98a..dfca309 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -764,9 +764,11 @@ _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate)
 	    }
 
 	    for (i = 0; i < n_boxes; ++i) {
-		cairo_rectangle_int_t clip_rect = { boxes[i].p1.x, boxes[i].p1.y,
-						    boxes[i].p2.x - boxes[i].p1.x,
-						    boxes[i].p2.y - boxes[i].p1.y };
+               cairo_rectangle_int_t clip_rect;
+               clip_rect.x = boxes[i].p1.x;
+               clip_rect.y = boxes[i].p1.y;
+               clip_rect.width = boxes[i].p2.x - boxes[i].p1.x;
+               clip_rect.height = boxes[i].p2.y - boxes[i].p1.y;
 
 		if (!_cairo_clip_int_rect_to_user(gstate, &clip_rect, &rectangles[i])) {
 		    _cairo_error_throw (CAIRO_STATUS_CLIP_NOT_REPRESENTABLE);
-- 
1.5.4.1


--3MwIy2ne0vdjdPXF--


More information about the cairo mailing list