Page 1 of 1

C++ macro help

Posted: Thu Dec 16, 2010 3:34 pm
by Mok
Hey there!

I've begun a Half-Life 2 mod some weeks ago. Today I found a quite weird macro with a bunch of # signs. What do these do?
Example:

Code: Select all

#define STUB_WEAPON_CLASS( entityName, className, baseClassName )	\
	class C_##className## : public baseClassName					\
	{																\
		DECLARE_CLASS( C_##className##, baseClassName );							\
	public:															\
		DECLARE_PREDICTABLE();										\
		DECLARE_CLIENTCLASS();										\
		C_##className() {};											\
	private:														\
		C_##className( const C_##className & );						\
	};																\
	STUB_WEAPON_CLASS_IMPLEMENT( entityName, C_##className );		\
	IMPLEMENT_CLIENTCLASS_DT( C_##className, DT_##className, C##className )	\
	END_RECV_TABLE()
Cheers, Mok.

Re: C++ macro help

Posted: Thu Dec 16, 2010 3:52 pm
by TomS
Mok, I'm gonna ask you the same thing, I aksed you in the german board: Why don't you ask your C++ questions in a C++ board?
Chances are, you would have gotten your answer in 5 minutes, whereas here it may take several days or weeks, if anyone will answer at all.