"Bob Paddock" <[EMAIL PROTECTED]> 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. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to