the -DARDUINO=<version> define when using avr-gcc


I am using a makefile with avr-gcc to compile an Arduino project (the ultimaker marlin firmware).

My question: there is the ARDUNIO= define used when calling avr-gcc - how important is it to set it to the correct Arduino IDE version that is used?

Is this define evaluated internally somewhere? or is it just a if version > 100 then to this, otherwise do that?

→ Reason for asking, there is a fork of said firmware which apparently behaves strange and I want to find out if it has something to do with the fact that the developer do not specify the ardiuno version “correctly” - as in they have it set to 165 despite using a different (newer) version of the Arduino framework/IDE.

Thanks! Oh this might not be the best section to ask this question - sorry :frowning: probably “Installation & Troubleshooting”?!

how important is it to set it to the correct Arduino IDE version that is used?

Does any of the code being compiled care? Most code does not.

The code of the firmware itself: no,
but does the Arduino core code care?

It’s not used anywhere in the Arduino AVR Boards core. It is used in the following libraries:

It’s possible it’s used in some of the 3rd party libraries that Marlin uses. The most common usage is:

#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#include <WProgram.h>

which would just cause compilation to fail because WProgram.h doesn’t exist in any IDE version from 1.0.0 onward but that’s not to say some library might not use it in a another way.


That is all I needed to know :slight_smile: