This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Using conditional instructions in a macro
- From: Pascal Francq <pfrancq at ulb dot ac dot be>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 1 Aug 2003 12:19:47 +0200
- Subject: Using conditional instructions in a macro
- Organization: Université Libre de Bruxelles
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