Bug 6456

Summary: WINVER must be defined before including <windows.h>
Product: cairo Reporter: Yevgen Muntyan <muntyan>
Component: win32 backendAssignee: Owen Taylor <otaylor>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high Keywords: patch
Version: 1.1.1   
Hardware: x86 (IA32)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: #define WINVER 0x0500

Description Yevgen Muntyan 2006-04-01 20:53:50 UTC
cairo uses features available when WINVER is defined to be >= 0x0500, so it 
must be defined before including <windows.h> (otherwise windows.h pulls every 
win32 header, and WINVER on mingw32 is undefined, and cairo doesn't build).
Comment 1 Yevgen Muntyan 2006-04-01 20:55:05 UTC
Created attachment 5154 [details] [review]
#define WINVER 0x0500

I doubt it counts as a real fix, but it fixes cross-compiling cairo with mingw.
Comment 2 Behdad Esfahbod 2006-08-16 17:52:49 UTC
Tor, can you take care of this please? Humm... what's Tor's bugzilla address here?
Comment 3 Tor Lillqvist 2006-08-20 10:12:45 UTC
Looks fine to me. For some reason I haven't needed this when building natively
on Windows with mingw. (I don't think WINVER will decrease the number of
sub-headers that <windows.h> includes, though?) I don't have write access to
cairo's code repository. (Or read access, for that matter, but that's my own
laziness in not bothering to find/build/learn git...)
Comment 4 Yevgen Muntyan 2006-08-20 10:45:56 UTC
(In reply to comment #3)
> Looks fine to me. For some reason I haven't needed this when building natively
> on Windows with mingw. 

Perhaps you have it silently defined somewhere somehow, like 
#ifndef WINVER
#define WINVER 0xFFFFF /* use newest and greatest */
#endif

My mingw is what's packaged by debian into mingw32 package.

> (I don't think WINVER will decrease the number of
> sub-headers that <windows.h> includes, though?) 

Apparently the only such place is in commdlg.h:
#if (WINVER >= 0x0500) && !defined (__OBJC__)
#include <unknwn.h>  /* for LPUNKNOWN  */
#include <prsht.h>   /* for HPROPSHEETPAGE  */
Comment 5 Behdad Esfahbod 2006-08-21 00:52:56 UTC
Committed:

  6de226be0e879709c4068cb7836d485e75928287

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.