Hi,

In the revisions.txt file from Arduino source code, in the section
related to changes from version 0022 to 1.0, there is this statement:

* The WProgram.h file, which provides declarations for the Arduino API,
  has been renamed to Arduino.h. To create a library that will work in
  both Arduino 0022 and Arduino 1.0, you can use an #ifdef that checks
  for the ARDUINO constant, which was 22 and is now 100.  For example:

  #if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #else
  #include "WProgram.h"
  #endif

This can be seen here:

https://github.com/arduino/Arduino/blob/master/build/shared/revisions.txt#L391-L400

There are some libraries which depend on the ARDUINO macro to be defined, or
will fallback to use WProgram.h. Since we are at 1.0.2, there is no longer
WProgram.h, and the compiler will fail.

The following diff defines this macro at runtime for such cases.

OK? Thank you.

Index: BSDmakefile
===================================================================
RCS file: /cvs/ports/devel/arduino/files/BSDmakefile,v
retrieving revision 1.7
diff -u -p -r1.7 BSDmakefile
--- BSDmakefile 14 May 2013 14:31:30 -0000      1.7
+++ BSDmakefile 18 Jun 2014 05:22:09 -0000
@@ -97,8 +97,8 @@ DEBUG = stabs
 OPT = s

 # Place -D or -U options here
-CDEFS = -DF_CPU=$(F_CPU)
-CXXDEFS = -DF_CPU=$(F_CPU)
+CDEFS = -DF_CPU=$(F_CPU) -DARDUINO=100
+CXXDEFS = -DF_CPU=$(F_CPU) -DARDUINO=100

 # Place -I options here
 ROOTLIBINCS=${LIBRARIES:S|^|-I$(ARDUINO)/libraries/|g}

Reply via email to