From:             
Operating system: ubuntu 10.04
PHP version:      5.3SVN-2011-10-18 (SVN)
Package:          *Graphics related
Bug Type:         Bug
Bug description:Code Error in cairo_surface.c

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!!!




-- 
Edit bug report at https://bugs.php.net/bug.php?id=60088&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60088&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60088&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60088&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60088&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60088&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60088&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60088&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60088&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60088&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60088&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60088&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60088&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60088&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60088&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60088&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60088&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60088&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60088&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60088&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60088&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60088&r=mysqlcfg

Reply via email to