Single line conditional compiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx
Web: http://www.gpvno.co.za
===============================================


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux