From: Volker Bartheld on
Hi!

I just tried to migrate one of our applications from wxMSW2.7.0 (where
it built fine) to wxMSW2.8.0rc1 and got the following compile errors:

c:\program files\wxwidgets\include\wx\app.h(230) : warning C4002: too many actual parameters for macro 'Yield'
c:\program files\wxwidgets\include\wx\app.h(230) : error C2059: syntax error : '{'
c:\program files\wxwidgets\include\wx\app.h(230) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
c:\program files\wxwidgets\include\wx\app.h(406) : warning C4002: too many actual parameters for macro 'Yield'
c:\program files\wxwidgets\include\wx\app.h(406) : error C2059: syntax error : '='
c:\program files\wxwidgets\include\wx\app.h(406) : error C2238: unexpected token(s) preceding ';'
c:\program files\wxwidgets\include\wx\msw\app.h(38) : warning C4002: too many actual parameters for macro 'Yield'
c:\program files\wxwidgets\include\wx\msw\app.h(38) : error C2208: 'bool' : no members defined using this type

As it seems, WXUNUSED is defined as
#define WXUNUSED(identifier) /* identifier */
by C:\Program Files\wxWidgets\include\wx\defs.h

but somehow the compiler doesn't like the function body definition
virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; }
in c:\program files\wxwidgets\include\wx\app.h anymore. Later, it
stumbles over
virtual bool Yield(bool onlyIfNeeded = false) = 0;
..

Does that ring a bell with anyone? I'm pretty much clueless here since I
couldn't spot any relevant changes in app.h between the two versions
mentioned above...

Please help!

Thanks,

Volker
__
Mail replies to/an V B A R T H E L D at G M X dot D E
From: Vadim Zeitlin on
On Wed, 13 Dec 2006 15:23:21 +0100 Volker Bartheld <dr_versaeg(a)freenet.de> wrote:

VB> but somehow the compiler doesn't like the function body definition
VB> virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; }
VB> in c:\program files\wxwidgets\include\wx\app.h anymore.

This is because you include, directly or indirectly, windows.h (which
#defines Yield) from somewhere. Make sure you always include
wx/msw/winundef.h after including windows.h.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Volker Bartheld on
Hi Vadim!

>VB> but somehow the compiler doesn't like the function body definition
>VB> virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; }
>VB> in c:\program files\wxwidgets\include\wx\app.h anymore.

> This is because you include, directly or indirectly, windows.h (which
>#defines Yield) from somewhere. Make sure you always include
>wx/msw/winundef.h after including windows.h.

HOLY LORD! You're right. It cost me a while and a bunch of #pragma
message()s to find out where to insert the #include <wx/msw/winundef.h>
but after all I fixed it.

THX! That really saved my day.


Volker

__
Mail replies to/an V B A R T H E L D at G M X dot D E