MAKE_VERSION(3)
π NAME π
MAKE_VERSION β bestie, this macro squishes the Allegro version into a single 32-bit integer π
πΈ SYNOPSIS πΈ
#include <allegro.h>
Macro MAKE_VERSION(a, b, c)
β¨ DESCRIPTION β¨
okay so real talk, this macro is your little version-detector π
You use it to check whether some Allegro version is (binary) compatible with the version you're currently building against. And ngl, it's totally safe to hit it with > and < to figure out which version is the more recent one. Comparison slays, periodt.
Now here's the tea π: the third number gets ignored when the second number is even. So like, MAKE_VERSION(4, 2, 0) is literally equivalent to MAKE_VERSION(4, 2, 1). Why? Because of Allegro's version numbering policy since 4.0.0: the second number is even for stable releases, and those must be ABI-compatible with earlier versions in the same series. That's the whole point, iykyk. π
This macro is mainly useful for addon packages and libraries β it's giving main character energy for anyone shipping a plugin π¦. For the full lore, go read the ABI compatibility information section of the manual.
Example, bestie:
/* 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 ALSO π₯
k bye ily, this page came from the Allegro manual, version 4.4.3 β mwah πβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms