This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

_Pragma from preprocessor macro: string escape problem

Hello!


I want to port a piece of software to cl6x toolchain (6.1.23, yes old, but tested).

Therefore i need to be able to have a define that can handle

_Pragma("DATA_SECTION(\".mySection\")")
void myFunction()...

as well as

__attribute__((section(".mySection")))
void myFunction()...

The goal now is to have a preprocessor macro that can produce either of them:

PRAGMA_DATA_SECTION(".mySection")
void myFunction()...

Producing the __attribute__ version is easy, but i can't get the preprocessor to get the string escape \" properly for the _Pragma call.

Any ideas how to get the cl6x preprocessor to do this?

Kind Regards