Hi Community,
I am trying to pass a macro through -D<MACRO> flag used with an ARM Clang compiler, specific to one use-case, similar to how it is passed during a C program compilation. Now, I need to check whether the macro is defined or not in my ARM Assembly code (for Cortex-R5, if that makes a difference).
The C-equivalent for this is as follows:
Now, I see that there are some conditional directives like .if, ,ifeq, .ifne available for Arm Compiler for Embedded Reference Guide. But, using `.ifdef MACRO` or `.if MACRO==1` works only when the -DMACRO is not used with the compilation command, and when used, it gives a compilation error: "error: expected absolute expression" and shows ".ifdef 1" next to it where 1 has replaced the passed MACRO with the -D flag.
Is there a way in which I can use it in code irrespective of whether it is passed or not and conditionally handle it in code using .if .else .endif instead of facing error in either of this check?
Thanks for reading.