I have a struct defined in MCU header file
typedef struct tagANSBBITS {
unsigned ANSB0:1;
unsigned ANSB1:1;
unsigned ANSB2:1;
unsigned ANSB3:1;
unsigned ANSB4:1;
unsigned :7;
unsigned ANSB12:1;
unsigned ANSB13:1;
unsigned ANSB14:1;
unsigned ANSB15:1;
} ANSBBITS;
Only some bits are defined because they are implemented in hw. The problem is I made myself a macro like this
#define pinMode(pin) pin(_ANS_F)
#define _ANS_F(alpha,bit) (ANS ## alpha ## bits.ANS ## alpha ## bit)
And used like this
pinMode(RED_LED) = 0;
Which obviously fails when corresponding ANSBx is not defined in structure. Can I test somehow for presence of ANSx before using macro? Or convince gcc this is ok?
Thanks in advance,