What does the macro WXUNUSED mean?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
elMiro
Knows some wx things
Knows some wx things
Posts: 31
Joined: Mon Apr 18, 2005 10:03 pm

What does the macro WXUNUSED mean?

Post by elMiro » Tue May 17, 2005 1:07 pm

Hello everybody,

in my generated code by KDevelop I have in my event handlers a WXUNUSED macro but could not find it in the documentation.
E.g.: void OnExit( wxCommandEvent& WXUNUSED( event ) )

Does anyone know where a description can be found or for what purposes it is used? More partability of code or such?


Many thanks in advance.


-elMiro-

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Re: What does the macro WXUNUSED mean?

Post by ABX » Tue May 17, 2005 1:23 pm

elMiro wrote:Does anyone know where a description can be found or for what purposes it is used? More partability of code or such?
It is described where it is defined, in defs.h. In the past it had different behaviour for portability between compilers. Nowadays it's just:

Code: Select all

/*  Macro to cut down on compiler warnings. */
#if 1 /*  there should be no more any compilers needing the "#else" version */
    #define WXUNUSED(identifier) /* identifier */
#else  /*  stupid, broken compiler */
    #define WXUNUSED(identifier) identifier
#endif
and it exists for backward compatibility with older source code.

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

Post Reply