Can CPP process only one "conditional" ?

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

 



Hello

I want to give the source code of my software (written in C and C++), either
in a freeware version or in a shareware version.

I could put something like this in my code :

#if FREE_VERSION
 …code A...
#else
 …code B...
#endif

then source files with the "code A" part would be given with the freeware
package.
and source files with the "code B" part would be given with the shareware
package.

I am wandering if CPP can generate output files corresponding to these two
different versions of my source code. In other words I would like CPP to
process only this conditional statement (FREE_VERSION), and _only_ this one!

In other words :) I would like CPP to give the exact same output files as
it's input files, except for this specific conditional.

>From what I have read in the CPP documentation and some faqs, I don't think
CPP can do the job. But if someone here thinks it can, then it would make
mine easier :)

Thanks in advance...
-- 
View this message in context: http://www.nabble.com/Can-CPP-process-only-one-%22conditional%22---tp17771975p17771975.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[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