php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60088 Code Error in cairo_surface.c
Submitted: 2011-10-18 20:27 UTC Modified: 2012-04-21 18:05 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sad_bunny at hotmail dot com Assigned: mgdm (profile)
Status: Closed Package: cairo (PECL)
PHP Version: 5.3SVN-2011-10-18 (SVN) OS: ubuntu 10.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sad_bunny at hotmail dot com
New email:
PHP Version: OS:

 

 [2011-10-18 20:27 UTC] sad_bunny at hotmail dot com
Description:
------------
I found a small coding bug in cairo_surface.c.

Trying to do a "make" of the cairo code I get an error message on line 647 of cairo_surface.c (transcript partially truncated at front):-

Downloads/pecl-cairo/cairo_surface.c: In function ‘php_cairo_get_surface_ce’:
Downloads/pecl-cairo/cairo_surface.c:647: error: ‘CAIRO_SURFACE_TYPE_RECORDING’ undeclared (first use in this function)
Downloads/pecl-cairo/cairo_surface.c:647: error: (Each undeclared identifier is reported only once
Downloads/pecl-cairo/cairo_surface.c:647: error: for each function it appears in.)

When I check the relevant section of the source file (cairo_surface.c) I see the following (in part):

================================================== ========================
#ifdef CAIRO_HAS_SVG_SURFACE
case CAIRO_SURFACE_TYPE_SVG:
type = cairo_ce_cairosvgsurface;
break;
#endif

#ifdef CAIRO_HAS_PS_SURFACE
case CAIRO_SURFACE_TYPE_PS:
type = cairo_ce_cairopssurface;
break;
#endif

#ifdef CAIRO_HAS_PS_SURFACE
case CAIRO_SURFACE_TYPE_RECORDING:
type = cairo_ce_cairorecordingsurface;
break;
#endif
==================================================

The #ifdef CAIRO_HAS_PS_SURFACE has been duplicated [in error].



Test script:
---------------
I was able to fix this simply by changing the *second* instance of the ifdef statement to read:-

#ifdef CAIRO_HAS_RECORDING_SURFACE
                case CAIRO_SURFACE_TYPE_RECORDING:
                        type = cairo_ce_cairorecordingsurface;
                        break;
#endif

[i.e. replace _PS_ with _RECORDING_ ] 

That seems to solve the problem and I can get the source to compile and install cleanly from that point onwards. 

I hope I'm reporting this at the right place!!!




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-03 20:12 UTC] iliaa@php.net
-Package: *Graphics related +Package: cairo
 [2012-04-21 18:05 UTC] mgdm@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mgdm
 [2012-04-21 18:05 UTC] mgdm@php.net
Thanks for picking those up, I fixed them a while ago but unfortunately forgot to 
comment here.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 04:01:29 2025 UTC