MAKE_VERSION(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– 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