Problem with compiler #if directive

Yes, it’s easy. When using .ino format, there is a pre-processing step that automatically extracts all function prototypes in the file, without respecting the macros, and places them on top of the file.

So your function declaration with the unknown ABCD type will be visible and declared at the top of the converted ino -> cpp file.

The absolute same should happen in the Arduino IDE if the pre-processing steps are the same.

Related topics are Build flags unexpected behavior - #2 by maxgerhardt and Tutorial for creating multi cpp file arduino project - #36 by normandunbar and ESP32 Arduino: Can someone explain me this behavior - #7 by maxgerhardt.

Please use .cpp files to not have unintended side effects during the .ino -> .cpp conversion. Also, you only get the full intellisense when it’s a .cpp file.