avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] User-visible library version numbers


From: Joerg Wunsch
Subject: [avr-libc-dev] User-visible library version numbers
Date: Wed, 24 Aug 2005 21:55:24 +0200
User-agent: Mutt/1.4.2.1i

It has been requested every now and then that there be a user-visible
library version number.  I'm about to start this with the impending
release of the 1.4 branch, so here are a few questions.

What to put in there?

. __AVR_LIBC_VERSION__ "1.4.0"  /* a string */
. __AVR_LIBC_MAJOR__   1        /* three integers */
. __AVR_LIBC_MINOR__   4
. __AVR_LIBC_TINY__    0
  or
. __AVR_LIBC_RELEASE__ 0x010400 /* a single integer */

The single integer approach only needs one macro, but it's a bit more
cumbersome to compare e.g. a major version only (but still possible).
The three integer approach requires more complicated preprocessor #if
statements if you e.g. want to do something only for version 1.4.3 and
above.


Where to put it?

. <avr/io.h>
. <avr/version.h>

I feel it rather deserves its own header file.  The advantage of
putting it into <avr/io.h> though is that any application can rely on
the existance of that file already right now, and could determine
avr-libc releases pre-1.4 still by seeing that the preprocessor
evaluates all those macros to 0 (i.e. #if __AVR_LIBC_RELEASE__ <
0x010400 would work as expected).  OTOH, <avr/io.h> requires the MCU
type to be set, i.e. it cannot be used inside custom library code that
is independent of a particular MCU (so it would not normally need the
MCU type to be set).  Of course, we could provide <avr/version.h>,
and then include it from <avr/io.h> (and document it that way).

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]