[cairo] Win32 build

Hans Breuer hans at breuer.org
Tue Apr 11 14:55:25 PDT 2006


On 11.04.2006 17:48, Alexander Larsson wrote:
> On Fri, 7 Apr 2006, Hans Breuer wrote:
> 
>> On 06.04.2006 15:50, Alexander Larsson wrote:
>>> I couldn't build the current cairo on win32 without the attached patch (or 
>>> something similar) because SHADEBLENDCAPS isn't defined. I'm not sure 
>>> defining WINVER like this is the best thing to do, because I'm not really 
>>> a windows developer, but it makes it work.
>>>
>> What we usually do for gdk is defining needed stuff for WINVER above 0x400
>> by hand. This is done to allow compilation with VC6 provided sdk and
>> to be sure to handle platform differences at runtime.
>> Simply defining WINVER to 0x500 would drop the compile time check
>> and thus silently bind to the newest win32 version (0x500 == win2k,
>> 0x501 ?= winxp)
>>
>> [Sorry no patch, cairo's version control is not compatible
>>   with my current os]
>>
> 
> Something like this? (patch attached)
> 
Looks good although I've done it a little different because it seemed a 
little strange to compare the failing case (for unknown in the OS)
against a than also unknown return value.

There was another problem compiling with msvc. New patch attached.

Thanks,
	Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert

-------------- next part --------------
diff --exclude-from=c:\util\tool\diff.ign -u --recursive src/cairo-lzw.c d:/temp/cairo/src/cairo-lzw.c
--- src/cairo-lzw.c	Sat Apr 08 20:24:38 2006
+++ d:/temp/cairo/src/cairo-lzw.c	Sat Apr 08 18:30:16 2006
@@ -318,7 +318,7 @@
  * lzw_buf without having to check for errors, (until a final check at
  * the end).
  */
-cairo_private unsigned char *
+cairo_public unsigned char *
 _cairo_lzw_compress (unsigned char *data, unsigned long *size_in_out)
 {
     int bytes_remaining = *size_in_out;
diff --exclude-from=c:\util\tool\diff.ign -u --recursive src/cairo-win32-surface.c d:/temp/cairo/src/cairo-win32-surface.c
--- src/cairo-win32-surface.c	Sat Apr 08 20:20:55 2006
+++ d:/temp/cairo/src/cairo-win32-surface.c	Sat Apr 08 18:32:43 2006
@@ -590,10 +590,7 @@
 
     if (alpha_blend == NULL)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
-#ifndef SHADEBLENDCAPS
-#define SHADEBLENDCAPS 45
-#endif
-    if (!GetDeviceCaps(dst->dc, SHADEBLENDCAPS))
+    if (GetDeviceCaps(dst->dc, SHADEBLENDCAPS) == SB_NONE)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
     
     blend_function.BlendOp = AC_SRC_OVER;
Only in src: makefile.msc


More information about the cairo mailing list