[cairo-commit] 2 commits - src/cairoint.h

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Sep 24 12:04:16 PDT 2008


 src/cairoint.h |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 6eee90784ea8174b346e389c2f61b599543685e4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 24 15:01:06 2008 -0400

    Enable CAIRO_HAS_UTF8_TO_UTF16 if PDF_OPERATORS is enabled
    
    We are being cheap and don't define the cairo_utf8_to_utf16 function
    if no one is using it.  Previously PS surface was not using it, but
    after the pdf-operators merge, it was.
    
    Before this commit, building with PS but without PDF failed.  Fixing.

diff --git a/src/cairoint.h b/src/cairoint.h
index add13d0..6b9a049 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2355,7 +2355,7 @@ cairo_private int
 _cairo_ucs4_to_utf8 (uint32_t    unicode,
 		     char       *utf8);
 
-#if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_SURFACE
+#if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS
 # define CAIRO_HAS_UTF8_TO_UTF16 1
 #endif
 #if CAIRO_HAS_UTF8_TO_UTF16
commit bb125689d3d3e623f84a02f4b6f2a0c8f5a7901f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 24 14:55:20 2008 -0400

    Simplify preprocessor conditional syntax
    
    We never do #ifdef-type conditions on CAIRO_HAS_* macros, because we
    want to allow setting them to zero.  Then if we need to enable a feature
    if either of PS or PDF is enabled, the proper syntax is:
    
    	#if CAIRO_HAS_PS_SURFACE || CAIRO_HAS_PDF_SURFACE
    
    This works because the preprocessor replaces any unknown identifiers with
    zero.  Some versions of gcc had a bug that got them very confused with
    complex versions of the above.  As a workaround for that I have been using
    the uglier version:
    
    	#if CAIRO_HAS_PS_SURFACE+0 || CAIRO_HAS_PDF_SURFACE+0
    
    which magically worked around that bug.  Or more recently replacing that
    with the duplicated version:
    
    	#if CAIRO_HAS_PS_SURFACE
    	...
    	#endif
    	#if CAIRO_HAS_PDF_SURFACE
    	...
    	#endif
    
    Both are uglier than the original.  Since the gcc bug was very short lived
    and there's lots of software out there relying on the original form to work,
    moving back to the simple version seems harmless.

diff --git a/src/cairoint.h b/src/cairoint.h
index 740281c..add13d0 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -72,20 +72,11 @@
 
 #include "cairo-compiler-private.h"
 
-#if CAIRO_HAS_PS_SURFACE
-#define CAIRO_HAS_FONT_SUBSET 1
-#endif
-#if CAIRO_HAS_PDF_SURFACE
-#define CAIRO_HAS_FONT_SUBSET 1
-#endif
-#if CAIRO_HAS_SVG_SURFACE
+#if CAIRO_HAS_PS_SURFACE || CAIRO_HAS_PDF_SURFACE || CAIRO_HAS_SVG_SURFACE
 #define CAIRO_HAS_FONT_SUBSET 1
 #endif
 
-#if CAIRO_HAS_PS_SURFACE
-#define CAIRO_HAS_PDF_OPERATORS 1
-#endif
-#if CAIRO_HAS_PDF_SURFACE
+#if CAIRO_HAS_PS_SURFACE || CAIRO_HAS_PDF_SURFACE
 #define CAIRO_HAS_PDF_OPERATORS 1
 #endif
 
@@ -2364,7 +2355,7 @@ cairo_private int
 _cairo_ucs4_to_utf8 (uint32_t    unicode,
 		     char       *utf8);
 
-#if CAIRO_HAS_WIN32_FONT+0 || CAIRO_HAS_QUARTZ_FONT+0 || CAIRO_HAS_PDF_SURFACE+0
+#if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_SURFACE
 # define CAIRO_HAS_UTF8_TO_UTF16 1
 #endif
 #if CAIRO_HAS_UTF8_TO_UTF16


More information about the cairo-commit mailing list