how come #include "*.cpp" works?

mwoehlke mwoehlke@tibco.com
Wed May 24 18:36:00 GMT 2006


Igor Peshansky wrote:
> On Wed, 24 May 2006, Dave Korn wrote:
>>   Perhaps it would be better to factor out the prototype generation into
>> a separate macro that could be invoked by both instances of "#define
>> CREATABLE_CLASS" ?
> 
> What's wrong with the following?
> 
> #define _CREATABLE_CLASS_DECL(name) \
> class name : virtual public OBJECT
> #define _CREATABLE_CLASS_PROTO(name) \
> extern class OBJECT* create_##name( int argc, const char* argv[] );
> 
> #ifndef CC_NO_CLASS_DECL
> #define CREATABLE_CLASS(name) \
> _CREATABLE_CLASS_PROTO(name) \
> _CREATABLE_CLASS_DECL(name)
> #else
> #define CREATABLE_CLASS(name) \
> _CREATABLE_CLASS_PROTO(name)
> #endif

Hmm, not bad\... I think I *will* actually use that; thanks!

And 'T_OBJ' is supposed to be 'OBJECT'; that's a typo on my part... see 
my other message which passed yours in the night :-).

-- 
Matthew
Doom doom dooM doo-DooM dOOm DOom doOM... DOOM! -- Gir



More information about the Cygwin-talk mailing list