AP_HAL_AVR: utility/vprintf.cpp fixed for avr-gcc 4.6

This commit is contained in:
Pat Hickey 2012-10-18 21:13:32 -07:00 committed by Andrew Tridgell
parent afa1143506
commit de81267bd5

View File

@ -54,7 +54,12 @@ extern "C" {
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR > 5
/* Need const type for progmem: new for avr-gcc 4.6 */
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
#else
#define PSTR(s) (__extension__({static const prog_char __c[] PROGMEM = (s); &__c[0];}))
#endif
#ifdef GETBYTE
#undef GETBYTE