This is the mail archive of the cygwin-talk mailing list for the cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how come #include "*.cpp" works?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]