avr_version(3avr)

๐ŸŽ€ avr_version ๐ŸŽ€

okay bestie, welcome to avr_version โ€” aka the avr_version(3avr) page โ€” where we talk about <avr/version.h> and all the lil macros that tell you which avr-libc you're running. it's giving "who am i, really" but for a C library. ๐Ÿ’–


๐ŸŒธ NAME ๐ŸŒธ

avr_version โ€” <avr/version.h>: the avr-libc version macros, aka the receipts for which version of the library you got. no cap.


โœจ SYNOPSIS โœจ

๐Ÿงš Macros

#define __AVR_LIBC_VERSION_STRING__   '2.2.1'
#define __AVR_LIBC_VERSION__   20201UL
#define __AVR_LIBC_DATE_STRING__   '20240718'
#define __AVR_LIBC_DATE_   20240718UL
#define __AVR_LIBC_MAJOR__   2
#define __AVR_LIBC_MINOR__   2
#define __AVR_LIBC_REVISION__   1

๐Ÿ“– Detailed Description

#include <avr/version.h>

so this header file defines macros that hold version numbers and strings describing the current version of avr-libc. literally its whole job. and it eats. ๐Ÿ’…

the version number itself is basically three pieces, separated by a dot: the major number, the minor number, and the revision number. periodt. but here's the tea โ€” for development versions (which use an odd minor number), the string representation additionally gets the date code (YYYYMMDD) appended. so if the minor is odd, expect a little date cameo at the end. ๐Ÿ—“๏ธโœจ

this file will also be included by <avr/io.h>. that way, portable tests can be implemented using <avr/io.h> that can be used in code that wants to remain backwards-compatible to library versions prior to the date when the library version API had been added โ€” because referenced but undefined C preprocessor macros automatically evaluate to 0. so old code doesn't explode, it just reads a lil zero. iconic behaviour fr fr. ๐Ÿซถ


๐Ÿ”ฅ MACRO DEFINITION DOCUMENTATION ๐Ÿ”ฅ

โญ #define __AVR_LIBC_DATE_ 20240718UL

the numerical representation of the release date. numbers only, no vibes, just math. ๐Ÿ’€

๐ŸŒˆ #define __AVR_LIBC_DATE_STRING__ '20240718'

the string literal representation of the release date. same date, but dressed up as a string. slay. ๐ŸŽ€

๐Ÿ‘‘ #define __AVR_LIBC_MAJOR__ 2

the library major version number. big number energy.

๐Ÿฆ‹ #define __AVR_LIBC_MINOR__ 2

the library minor version number. (and remember bestie: if this one's odd, you're on a development version and the date code tags along in the string โœจ)

๐Ÿ“ #define __AVR_LIBC_REVISION__ 1

the library revision number. the final lil dot-piece of the version trio.

๐Ÿ’– #define __AVR_LIBC_VERSION__ 20201UL

the numerical representation of the current library version. ๐Ÿงฎ

here's the math, and it's honestly kinda cute: in the numerical representation, the major number is multiplied by 10000, the minor number by 100, and then all three parts are added together. it is intented to provide a monotonically increasing numerical value that can easily be used in numerical checks. so it only ever goes up and you can just compare numbers. main character energy. ๐Ÿ“ˆ

ngl, "intented" is spelled that way in the original docs and we are preserving the lore. do not come for me. ๐Ÿ™ˆ

๐Ÿซถ #define __AVR_LIBC_VERSION_STRING__ '2.2.1'

the string literal representation of the current library version. for when you wanna print it or show it off at a party. ๐Ÿ’œ


๐Ÿ’ซ AUTHOR ๐Ÿ’ซ

generated automatically by Doxygen for AVR-LibC from the source code. not a human, just a very diligent robot. ๐Ÿค–๐ŸŒธ


okay that's the whole page bestie, you now know every single macro here, no skips, no summaries, we kept the whole roster. ๐Ÿซก

this was brought to you by AVR-LibC, Version 2.2.1, and that very same 2.2.1 / release date code 20240718 you kept seeing all over this page. go forth and version-check responsibly. iykyk ๐Ÿ’–โœจ๐ŸŽ€
๐Ÿ“ฆ where this page comes from