From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Nov 23 18:10:14 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E693216A415 for ; Thu, 23 Nov 2006 18:10:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6A0C43D62 for ; Thu, 23 Nov 2006 18:09:37 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kANIADJO021400 for ; Thu, 23 Nov 2006 18:10:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kANIADYT021399; Thu, 23 Nov 2006 18:10:13 GMT (envelope-from gnats) Resent-Date: Thu, 23 Nov 2006 18:10:13 GMT Resent-Message-Id: <200611231810.kANIADYT021399@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sven Berkvens-Matthijsse Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61F2116A415 for ; Thu, 23 Nov 2006 18:03:06 +0000 (UTC) (envelope-from sven@berkvens.net) Received: from berkvens.net (ip5452aa82.speed.planet.nl [84.82.170.130]) by mx1.FreeBSD.org (Postfix) with SMTP id 3F0F743D7C for ; Thu, 23 Nov 2006 18:02:28 +0000 (GMT) (envelope-from sven@berkvens.net) Received: (qmail 89343 invoked by uid 103); 23 Nov 2006 18:03:02 -0000 Message-Id: <20061123180302.89342.qmail@cat.berkvens.net> Date: 23 Nov 2006 18:03:02 -0000 From: Sven Berkvens-Matthijsse To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/105796: [PATCH] Port graphics/py-cairo does not compile with GCC 2.x X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sven Berkvens-Matthijsse List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2006 18:10:15 -0000 >Number: 105796 >Category: ports >Synopsis: [PATCH] Port graphics/py-cairo does not compile with GCC 2.x >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 23 18:10:12 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Sven Berkvens-Matthijsse >Release: FreeBSD 4.10-STABLE i386 >Organization: de Kattenfabriek >Environment: System: FreeBSD cat.berkvens.net 4.10-STABLE FreeBSD 4.10-STABLE #4: Sun Oct 31 01:46:30 CEST 2004 sven@cat.berkvens.net:/extra0/usr_obj/usr/src/sys/CAT i386 >Description: py-cairo does not compile with GCC 2.x due to the use of some C99 features. >How-To-Repeat: Build py-cairo on FreeBSD 4.x. >Fix: The following two patch files will fix the problem and will not break anything for more recent versions of FreeBSD. ========== /usr/ports/graphics/py-cairo/files/patch-pycairo-font.c ========= --- cairo/pycairo-font.c.orig Thu Nov 23 18:52:59 2006 +++ cairo/pycairo-font.c Thu Nov 23 18:53:11 2006 @@ -197,6 +197,7 @@ PycairoFontFace *ff; PycairoFontOptions *fo; PycairoMatrix *mx1, *mx2; + PyObject *o; if (!PyArg_ParseTuple(args, "O!O!O!O!:ScaledFont.__new__", &PycairoFontFace_Type, &ff, @@ -205,7 +206,7 @@ &PycairoFontOptions_Type, &fo)) return NULL; - PyObject *o = type->tp_alloc(type, 0); + o = type->tp_alloc(type, 0); if (o != NULL) { cairo_scaled_font_t *scaled_font = cairo_scaled_font_create (ff->font_face, &mx1->matrix, &mx2->matrix, fo->font_options); ========================== END OF FILE ===================================== ======== /usr/ports/graphics/py-cairo/files/patch-pycairo-surface.c ======= --- cairo/pycairo-surface.c.orig Thu Nov 23 18:53:35 2006 +++ cairo/pycairo-surface.c Thu Nov 23 18:55:42 2006 @@ -34,7 +34,9 @@ # include #endif +#if defined(__FreeBSD__) && __FreeBSD__ >= 50000 #include +#endif #include "pycairo-private.h" @@ -519,6 +521,7 @@ static PyObject * image_surface_create_from_png (PyTypeObject *type, PyObject *file) { + PyObject* reader; if (PyObject_TypeCheck (file, &PyBaseString_Type)) { return PycairoSurface_FromSurface ( cairo_image_surface_create_from_png (PyString_AsString(file)), @@ -526,7 +529,7 @@ } /* file or file-like object argument */ - PyObject* reader = PyObject_GetAttrString (file, "read"); + reader = PyObject_GetAttrString (file, "read"); if (reader == NULL || !PyCallable_Check (reader)) { Py_XDECREF(reader); PyErr_SetString(PyExc_TypeError, @@ -700,6 +703,7 @@ { double width_in_points, height_in_points; PyObject *file; + PyObject* writer; if (!PyArg_ParseTuple(args, "Odd:PDFSurface.__new__", &file, &width_in_points, &height_in_points)) @@ -713,7 +717,7 @@ NULL); } /* file or file-like object argument */ - PyObject* writer = PyObject_GetAttrString (file, "write"); + writer = PyObject_GetAttrString (file, "write"); if (writer == NULL || !PyCallable_Check (writer)) { Py_XDECREF(writer); PyErr_SetString(PyExc_TypeError, @@ -803,6 +807,7 @@ { double width_in_points, height_in_points; PyObject *file; + PyObject* writer; if (!PyArg_ParseTuple(args, "Odd:PSSurface.__new__", &file, &width_in_points, &height_in_points)) @@ -817,7 +822,7 @@ } /* else: file or file-like object argument */ - PyObject* writer = PyObject_GetAttrString (file, "write"); + writer = PyObject_GetAttrString (file, "write"); if (writer == NULL || !PyCallable_Check (writer)) { Py_XDECREF(writer); PyErr_SetString(PyExc_TypeError, @@ -942,6 +947,7 @@ { double width_in_points, height_in_points; PyObject *file; + PyObject* writer; if (!PyArg_ParseTuple(args, "Odd:SVGSurface.__new__", &file, &width_in_points, &height_in_points)) @@ -955,7 +961,7 @@ NULL); } /* else: file or file-like object argument */ - PyObject* writer = PyObject_GetAttrString (file, "write"); + writer = PyObject_GetAttrString (file, "write"); if (writer == NULL || !PyCallable_Check (writer)) { Py_XDECREF(writer); PyErr_SetString(PyExc_TypeError, ========================== END OF FILE ===================================== >Release-Note: >Audit-Trail: >Unformatted: