avr_version(3)
π NAME π
avr_version β the lil' header that tells you exactly which avr-libc you're living in, bestie πΈ
β¨ SYNOPSIS β¨
Macros
#define __AVR_LIBC_VERSION_STRING__ '2.1.0'
#define __AVR_LIBC_VERSION__ 20100UL
#define __AVR_LIBC_DATE_STRING__ '20220128'
#define __AVR_LIBC_DATE_ 20220128UL
#define __AVR_LIBC_MAJOR__ 2
#define __AVR_LIBC_MINOR__ 1
#define __AVR_LIBC_REVISION__ 0
Detailed Description
#include <avr/version.h>
Okay so this header file is giving version info β it defines a bunch of macros holding the version numbers and the strings that describe whatever version of avr-libc you've got right now. π
The version number itself? Basically three little pieces glued together with dots: the major number, the minor number, and the revision number. And here's the tea β β for development versions (the ones with an odd minor number, iykyk), the string representation also gets the date code (YYYYMMDD) tacked on the end.
Also!! This file gets pulled in by <avr/io.h> too. Which means you can write portable tests using <avr/io.h> that still work on code wanting to stay backwards-compatible with library versions from before the library version API existed β because any C preprocessor macro that's referenced but never defined automatically evaluates to 0. Iconic behaviour honestly π
π MACRO DEFINITION DOCUMENTATION π
#define __AVR_LIBC_DATE_ 20220128UL
The release date, but make it numbers. π’
#define __AVR_LIBC_DATE_STRING__ '20220128'
The release date, but make it a string literal. π§
#define __AVR_LIBC_MAJOR__ 2
Library major version number. π
#define __AVR_LIBC_MINOR__ 1
Library minor version number. π¦
#define __AVR_LIBC_REVISION__ 0
Library revision number. π
#define __AVR_LIBC_VERSION__ 20100UL
Numerical representation of the current library version. π―
So in this numerical form, the major number gets multiplied by 10000, the minor number by 100, and then all three parts get added together. The whole point is to hand you a value that increases monotonically so you can slap it into numerical checks with zero drama. Slay.
#define __AVR_LIBC_VERSION_STRING__ '2.1.0'
String literal representation of the current library version. β¨
π«Ά Author π«Ά
Generated automatically by Doxygen for avr-libc, straight from the source code. Not a human, just a very diligent robot π€
And that's the whole page, bestie β no cap, you now know everything there is to know about avr_version(3) from the avr-libc manual. π
Version 2.1.0, dated Sat Jan 29 2022. Byeee, go compile something cute πβ¨
π¦ where this page comes from
- fedora 43: avr-libc 2.2.1-3.fc43 Β· BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms