WX_DECLARE_LIST usage

Chad Wagner chad at chadawagner.com
Mon Oct 2 07:53:33 PDT 2006


Thanks for the quick response, unfortunately either I was half asleep  
when I posted or I'm already showing my newbieness.  You're right,  
the WX_DEFINE_LIST looks fine to me as well, what I meant to say is  
that WX_DECLARE_LIST is the culprit.

In list.h WX_DECLARE_LIST leads to WX_DECLARE_LIST_XO or  
WX_DECLARE_LIST_4 (depending on wxUSE_STL), in either case resulting  
in a class declaration without the terminating semicolon, which is  
what my compiler does not like.  For example, my .h file might look  
like this:

class MyControl : public wxControl
{
	DECLARE_CLASS(MyControl)
public:
	MyControl();
	virtual ~MyControl() {}
	// etc
};
WX_DECLARE_LIST(MyControl, MyControlList);

For now I will include the semicolon explicitly, and certainly can  
live with it.  I am just trying to get my head around all this wx  
macro stuff.

Thanks,
Chad

On Oct 2, 2006, at 4:10 AM, Vadim Zeitlin wrote:

> On Sun, 01 Oct 2006 20:50:22 -0400 Chad Wagner  
> <chad at chadawagner.com> wrote:
>
> CW> I decided to drill-down into the WX_DEFINE_LIST  definition,  
> which I
> CW> found does not provide its own semicolon at the  end.
>
>  I don't see this. In both wxUSE_STL==0 and wxUSE_STL==1 cases  
> there is no
> need for a semicolon after this macro AFAICS.
>
>  FWIW, I believe -- following K&R -- that there should be  
> semicolons after
> the macros but historically wxWidgets doesn't do it this way so  
> none of wx
> declaration-like macros need to be followed by semicolon. At least  
> this is
> internally consistent.
>
>  Regards,
> VZ
>
> -- 
> TT-Solutions: wxWidgets consultancy and technical support
>                http://www.tt-solutions.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20061002/2d78f132/attachment.htm


More information about the wx-users mailing list