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

Computed Values in Preprocessor


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


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