[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] LIBC 1.2.6 vs 1.4.0 header files, FLASH and EEPROM
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] LIBC 1.2.6 vs 1.4.0 header files, FLASH and EEPROM |
Date: |
Tue, 6 Dec 2005 20:37:53 +0100 (MET) |
"Bob Paddock" <address@hidden> wrote:
> #ifdef __GNUC__
>
> #define __GCC_VERSION__ (__GNUC__ * 10000 \
> + __GNUC_MINOR__ * 100 \
> + __GNUC_PATCHLEVEL__)
Why not test for
#if __AVR_LIBC_VERSION__ < 10400UL
put old code here
#endif
That macro comes from <avr/version.h>, but that file didn't exist
previously, so in order to give people a transition path, we decided
to include that file from <avr/io.h> as that is usually going to be
included in virtually any AVR project anyway. (Code that is only
supposed to work with avr-libc 1.4 and above is encouraged to
explicitly #include <avr/version.h> though.)
Any C preprocessor macro that hasn't been defined but is used in a
preprocessor expression as shown above automatically evaluates to 0,
so the above test will work.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)