public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Single line conditional compiles
@ 2005-07-28 16:02 Gerrit van Niekerk
  2005-07-28 16:08 ` random
  2005-07-28 16:16 ` Eljay Love-Jensen
  0 siblings, 2 replies; 4+ messages in thread
From: Gerrit van Niekerk @ 2005-07-28 16:02 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-28 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-28 16:02 Single line conditional compiles Gerrit van Niekerk
2005-07-28 16:08 ` random
2005-07-28 19:51   ` Gerrit van Niekerk
2005-07-28 16:16 ` Eljay Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).