This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Computed Values in Preprocessor
- From: "aetherane (sent by Nabble.com)" <lists at nabble dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 29 Sep 2005 12:30:44 -0700 (PDT)
- Subject: Computed Values in Preprocessor
- Reply-to: aetherane <aetherane at gmail dot com>
I have a constant defined, lets call it A:
#define A 1
I want to have another constant defined called be such that B=A+2 so you could do:
#define B A+2
The issue is that I need B to be computed as the value of A+2, not as "A+2" which will be directly plugged into code where ever B is referenced. Is there any way to define a token as the combined value of numbers?
The reason I need this is because I use the definition in assembly as well as c, and '+' isn't too assembly friendly.
--
Sent from the gcc - General forum at Nabble.com:
http://www.nabble.com/Computed-Values-in-Preprocessor-t359703.html#a996023