Go Down

Topic: Arduino 0012 available. (Read 5 times) previous topic - next topic

mellis

You should also just be able to:

#undef int

mem

David, not sure why, but that didn't work when I tried:

Code: [Select]
#undef int

int (*statefun)();
void loop ()
   {int a = 1;}

void setup ()
   {int b = 2;}

runtux

mellis writes:
Quote
You should also just be able to:

#undef int

and mem notes:
Quote
David, not sure why, but that didn't work...


sorry for not reporting this: Yes I also tried to #undef int without success after having read other posts concerning this bug  ;) in 0011

I'd vote for removing this #define or at least allow to turn it off via a #define (or #undef if somebody finds out how).

Just did some more testing: The #undef works if there is some other statement before it. So
Code: [Select]
typedef int zoppel;
#undef int
int (*statefun)();


works, while removing the typedef line doesn't. Weird. Maybe this is related to the following fix in the announcement:
Quote

* Moved insertion of #include <WProgram.h> to after any comments and #include statements in the main sketch file.  This means that an #include <stdlib.h> now works.


So it looks as if the #include is moved *after* the #undef rendering it useless if the #undef isn't preceded by a statement.

Go Up