SDL_NET_VERSION_ATLEAST(3)
β¨ 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
- fedora 43: SDL3_net-devel 3.2.0-2.fc43 Β· Zlib
- fedora 43: SDL3_net-devel 3.2.0-2.fc43 Β· Zlib
- fedora 44: SDL3_net-devel 3.2.0-2.fc44 Β· Zlib
- fedora 44: SDL3_net-devel 3.2.0-2.fc44 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms