Bug 29535

Summary: [Qt] Buildfix on Windows building with MSVC
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Blocker CC: zoltan
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
proposed patch
none
proposed patch none

Description Csaba Osztrogonác 2009-09-21 00:18:59 PDT
The error message:
..\..\..\JavaScriptCore\wtf/Vector.h(276) : warning C4003: not enough actual parameters for macro 'max'
t:\webkit_git\javascriptcore\wtf\HashTraits.h(72) : warning C4003: not enough actual parameters for macro 'max'
t:\webkit_git\javascriptcore\wtf\HashTraits.h(73) : warning C4003: not enough actual parameters for macro 'max'
t:\webkit_git\javascriptcore\wtf\HashTraits.h(74) : warning C4003: not enough actual parameters for macro 'max'
..\..\..\JavaScriptCore\runtime/UString.h(93) : warning C4003: not enough actual parameters for macro 'max'
..\..\..\JavaScriptCore\runtime/UString.h(93) : error C2589: '(' : illegal token on right side of '::'
..\..\..\JavaScriptCore\runtime/UString.h(93) : error C2059: syntax error : '::'
..\..\..\JavaScriptCore\runtime/UString.h(93) : error C2143: syntax error : missing ';' before '{'
..\..\..\JavaScriptCore\jit\ExecutableAllocator.h(60) : warning C4003: not enough actual parameters for macro 'max'
..\..\..\JavaScriptCore\jit\ExecutableAllocator.h(60) : error C2589: '(' : illegal token on right side of '::'
..\..\..\JavaScriptCore\jit\ExecutableAllocator.h(60) : error C2059: syntax error : '::'
..\..\..\JavaScriptCore\jit\ExecutableAllocator.h(61) : error C2143: syntax error : missing ';' before '{' QNetworkReplyHandler.cpp

Build error caused by define max(a,b) in a standard windows header (WinDef.h). Here max function must be used instead of max macro, accordingly max macro shouldn't be defined here. ( std::numeric_limits<T>::max() , ... )
Comment 1 Csaba Osztrogonác 2009-09-21 00:20:51 PDT
Created attachment 39841 [details]
proposed patch
Comment 2 Csaba Osztrogonác 2009-09-21 07:54:52 PDT
Created attachment 39851 [details]
proposed patch

Simon Hausmann pointed to missing include config.h .
I tried it, and works correctly. Here is the simpler patch.
Comment 3 Zoltan Horvath 2009-09-21 08:50:20 PDT
Landed in http://trac.webkit.org/changeset/48583