MAKE_VERSION(3alleg4)
π MAKE_VERSION π
okay bestie, welcome to the Allegro manual page for MAKE_VERSION, from the 3alleg4 section. buckle up, this one's short but it's important. β¨
πΈ NAME πΈ
MAKE_VERSION β bestie, this macro makes a 32 bit integer out of an Allegro version. that's it. that's the whole job. π
π SYNOPSIS π
#include <allegro.h>
Macro MAKE_VERSION(a, b, c)
like yes it's a macro, not a function, so no & shenanigans, no linking drama, just vibes. π¦
β¨ DESCRIPTION β¨
so here's the tea, bestie: this macro is how you check if some Allegro version is (binary) compatible with the version you're currently building against. and ngl, it's genuinely well-behaved β it is safe to use > and < to check if one version is more recent than another. no cursed comparisons, no weird gotchas. slay. π
but wait, there's a plot twist π«Ά: the third number is ignored if the second number is even. so
MAKE_VERSION(4, 2, 0)
is literally equivalent to
MAKE_VERSION(4, 2, 1)
and that is not a bug, it's on purpose. it's because of the version numbering policy since 4.0.0: the second number is even for stable releases, and those have to be ABI-compatible with earlier versions of the same series. so yeah, the patch number in a stable series is basically decoration for comparison purposes. periodt. π
this macro is mainly useful for addon packages and libraries β the people shipping code that has to survive across Allegro versions without breaking. if that's you, hiii, this is for you. π
if you want the full deep-dive lore, go read the `ABI compatibility information' section of the manual. it's giving required reading, fr fr.
and here's an example, because seeing it > reading about it, always:
/* Check if the current version is compatible with Allegro 4.2.0 */
#if (MAKE_VERSION(4, 2, 0) <= MAKE_VERSION(ALLEGRO_VERSION, \
ALLEGRO_SUB_VERSION, ALLEGRO_WIP_VERSION))
/* Allegro 4.2.0 compatibility */
#else
/* Work-around */
#endif
see how the \ keeps that line going? iconic. don't lose it. π
π SEE ALSO π
(the whole squad. go read all three, iykyk. π)
and that's the page!! π this was Allegro, version 4.4.3, and this MAKE_VERSION(3alleg4) moment was brought to you by the date at the bottom of the original page (which, bestie, is exactly where you'd find it β i'm just too cute to make you scroll). mwah. ππ§β¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms