SDL_NET_VERSION_ATLEAST(3)

πŸ“¦
version 3.2.0 Β· 2 versions
, in fedora 43, fedora 44

✨ SDL_NET_VERSION_ATLEAST ✨

okay bestie, gather round, because this one is literally a compile-time vibe check πŸ’… and it lives in the SDL_net3 FUNCTIONS part of the SDL_net manual, so you know it's the real deal.

πŸŽ€ NAME πŸŽ€

SDL_NET_VERSION_ATLEAST β€” this macro will evaluate to true if you compiled with SDL_net at least X.Y.Z. that's it, that's the whole personality 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

first things first, you gotta pull in the header:

#include <SDL3_net/SDL_net.h>

and here's the macro itself, no cap, copy it exactly:

#define SDL_NET_VERSION_ATLEAST(X, Y, Z) \
    ((SDL_NET_MAJOR_VERSION >= X) && \
     (SDL_NET_MAJOR_VERSION > X || SDL_NET_MINOR_VERSION >= Y) && \
     (SDL_NET_MAJOR_VERSION > X || SDL_NET_MINOR_VERSION > Y || SDL_NET_MICRO_VERSION >= Z))

like, look at her go πŸƒβ™€οΈ she's checking X against SDL_NET_MAJOR_VERSION, then Y against SDL_NET_MINOR_VERSION, then Z against SDL_NET_MICRO_VERSION, and only saying yes if every single one of those comparisons comes back happy. it's giving "three checkpoints, zero shortcuts" πŸ”₯


πŸ’– AVAILABILITY πŸ’–

this macro has been available since SDL_net 3.0.0 β€” so she's been here since basically day one, an OG, an icon, a legend πŸ‘‘


ngl the way this works is so satisfying: it's not checking one number, it's checking the whole X.Y.Z stack in order, so a newer major always wins, and only when majors tie does the minor get a say, and only when both tie does the micro step up. hierarchy, but make it adorable 🫢

and that's the whole page, fr fr. this was SDL_net manual entry SDL_NET_VERSION_ATLEAST(3), straight out of SDL_net version 3.2.0 πŸ’– go forth and version-check responsibly, bestie βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from