[cairo] 3rd cairo 1.4.6 release-candidate snapshot available

Adrian Johnson ajohnson at redneon.com
Sun Apr 29 03:29:15 PDT 2007

Testing cairo-1.4.5-20070428-7e6ab5.tar.gz  with cygwin I get the following:

cairo-win32-surface.c:47:1: warning: "WINVER" redefined
In file included from 
                 from ./cairo-win32.h:43,
                 from cairo-win32-private.h:39,
                 from cairo-win32-surface.c:42:
warning: this is the location of the previous definition
cairo-win32-surface.c: In function `_cairo_win32_surface_composite':
cairo-win32-surface.c:987: warning: comparison of unsigned expression < 
0 is always false
cairo-win32-surface.c:987: warning: comparison of unsigned expression < 
0 is always false
cairo-win32-surface.c: In function `_cairo_win32_surface_show_glyphs':
cairo-win32-surface.c:1597: error: `ETO_PDY' undeclared (first use in 
this function)
cairo-win32-surface.c:1597: error: (Each undeclared identifier is 
reported only once
cairo-win32-surface.c:1597: error: for each function it appears in.)
cairo-win32-surface.c: In function `DllMain':
cairo-win32-surface.c:1924: error: parse error before '(' token
make[2]: *** [cairo-win32-surface.lo] Error 1
make[2]: Leaving directory 
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/d/cairo/cairo-1.4.5-20070428-7e6ab5'
make: *** [all] Error 2

The attached patch fixes the WINVER and ETO_PDY undefined problems. The 
problem is that
the WINVER, _WIN32_WINNT,  and WIN32_LEAN_AND_MEAN macros need to be 
defined before
windows.h is included. However after the recent include file changes 
windows.h is included indirectly
in cairo-win32-surface.c before these macros are defined. The patch 
moves the macros to before all the include
files to ensure they are defined when windows.h is included regardless 
of where it is included from. I've
also removed the redundant redefinition from cairo-mutex-private.h.

I'll leave it to someone more familiar with cairo-mutex-private.h to fix 
the mutex macros.

Line 1924 of cairo-win32-surface.c is:


and after preprocessing it is:

            do { } while (0) ();

-------------- next part --------------
>From 4cf80aa3bba8804ddb717d64fb5c4d11a95ce989 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <ajohnson at redneon.com>
Date: Sun, 29 Apr 2007 19:29:24 +0930
Subject: [PATCH] Fix cygwin compile error

The WINVER macros need to be defined before including <windows.h>.
As a result of some recent include file rearranging, <windows.h>
was included indirectly before WINVER was defined.
 src/cairo-mutex-private.h |   12 ------------
 src/cairo-win32-surface.c |   11 ++++++-----
 2 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/cairo-mutex-private.h b/src/cairo-mutex-private.h
index 9b9adba..85757a5 100644
--- a/src/cairo-mutex-private.h
+++ b/src/cairo-mutex-private.h
@@ -80,18 +80,6 @@ CAIRO_BEGIN_DECLS
 #elif HAVE_WINDOWS_H /*******************************************************/
-/* We require Windows 2000 features. Although we don't use them here, things
- * should still work if this header file ends up being the one to include
- * windows.h into a source file, so: */
-# if !defined(WINVER) || (WINVER < 0x0500)
-#  define WINVER 0x0500
-# endif
-# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-#  define _WIN32_WINNT 0x0500
-# endif
-# define WIN32_LEAN_AND_MEAN
 # include <windows.h>
   typedef CRITICAL_SECTION cairo_mutex_t;
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index e680715..a907fd8 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -36,11 +36,6 @@
  *	Vladimir Vukicevic <vladimir at pobox.com>
-#include "cairoint.h"
-#include "cairo-clip-private.h"
-#include "cairo-win32-private.h"
 #define WIN32_LEAN_AND_MEAN
 /* We require Windows 2000 features such as ETO_PDY */
 #if !defined(WINVER) || (WINVER < 0x0500)
@@ -49,6 +44,12 @@
 #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
 # define _WIN32_WINNT 0x0500
+#include "cairoint.h"
+#include "cairo-clip-private.h"
+#include "cairo-win32-private.h"
 #include <windows.h>
 #if defined(__MINGW32__) && !defined(ETO_PDY)

More information about the cairo mailing list