This is the mail archive of the gcc-help@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]

Single line conditional compiles


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
===============================================


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