does anyone know a way to accomplish nested defines, such as:
#define neword(name,idx) #define name idx
neword(xENTER,5)
#define xENTER 5
It is impossible to include pre-processor statements in a pre-preprocessor statement as you have written. You want the token pasting operator, see the explanation at:
http://www.eskimo.com/~scs/C-faq/q11.17.html