Hi!
I'm trying to use the following code to use "#pragma UNROLL(...); from a macro:
#define PRAGMA(x) _Pragma(#x) #define P_UNROLL(cnt) \ PRAGMA(UNROLL(cnt)) #define ANYNUMBER 42 P_UNROLL(ANYNUMBER) for (i=0;i<ANYNUMBER;i++) { doSomething(i); }
We use the same PRAGMA macro sheme for DATA_SECTION and CODE_SECTION. Works perfectly.
But this one yields "error #612: this kind of pragma may not be used here"
Why do we use _Pragma and not #pragma? We want to compile the same code with cl6x and gcc. But gcc doesn't know "#pragma UNROLL", so we try to hide it in a macro.
Any ideas?