This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Using conditional instructions in a macro


Hi, 
I try to make a macro that uses conditional instructions in it. Here is the 
code:

//------------------------------------------------------------------------------
#define DUMMI(about)                                                           
\
	#if about                                                                  \
		virtual void About(void) {MyClass::About();}                           \
		virtual bool HasAbout(void) const {return(true);}                      \
	#else                                                                      \
		virtual void About(void) {}                                            \
		virtual bool HasAbout(void) const {return(false);}                     \
	#endif

When I compile, an error occurs at the line with the #if instruction:

 '#' is not followed by a macro parameter


Any ideas?
-- 


Dr Ir Pascal Francq
Researcher
Université Libre de Bruxelles
CAD/CAM Department
Avenue F.D. Roosevelt, 50
CP 165/14
B-1050 Brussels
BELGIUM
Tel. +32-2-650 47 65
Fax +32-2-650 47 24
ICQ: 91206668


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