This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Single line conditional compiles
- From: "Gerrit van Niekerk" <gerritvn at gpvno dot co dot za>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 28 Jul 2005 18:00:45 +0200
- Subject: Single line conditional compiles
- Reply-to: gerritvn at gpvno dot co dot za
How can one implement single line conditional compile macros with GCC?
Instead of having:
#ifdef OPT1
<valid C line>
#endif
Having something like:
IFOPT1 <valid C line>
The following works with BorlandC, but not GCC:
#ifdef OPT1
#define IFOPT1
#else
#define IFOPT1 /##/
#endif
I understand why it does not work - I am looking for a solution, not an
explanation :)
===============================================
Gerrit van Niekerk
GP van Niekerk Ondernemings BK
Roosstraat 211, Meyerspark, 0184, South Africa
Tel: +27(12)8036501 Fax SA: 0866 413 555
Fax Int'l: +12(06)2034131
Email: gerritvn@gpvno.co.za
Web: http://www.gpvno.co.za
===============================================