SDL_VERSIONNUM_MICRO(3)

πŸ’– SDL_VERSIONNUM_MICRO πŸ’–

okay bestie, welcome to the SDL_VERSIONNUM_MICRO(3) page β€” she's a lil macro from the SDL3 FUNCTIONS crew and she's here to do exactly one thing and do it flawlessly ✨


🌸 NAME 🌸

SDL_VERSIONNUM_MICRO β€” this macro extracts the micro version from a version number. that's it. that's her whole job. and she eats every time πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_version.h>

#define SDL_VERSIONNUM_MICRO(version) ((version) % 1000)

like. look at her. one line of math and she's iconic πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: you hand her a big chunky version number and she pulls the micro part right out of it.

1002003 becomes 3.

literally that's it. no cap. she takes the number, does the % 1000 thing, and the last chunk is yours πŸŽ€


πŸ“ MACRO PARAMETERS πŸ“

  • version β€” the version number. that's the one. the whole entire input. give her the number and she'll give you the micro back 🫢

🌈 THREAD SAFETY 🌈

good news, bestie: it is safe to call this macro from any thread. no locks, no drama, no "wait whose turn is it" energy. every thread gets to party πŸ’–


⭐ AVAILABILITY ⭐

this macro is available since SDL 3.2.0. so if you're on something older... girl. upgrade 😭


ngl if you're staring at a version number wondering "what's the micro" β€” this is the macro. she's small, she's safe from any thread, and she's been here since SDL 3.2.0. main character energy fr fr ✨

that's the whole page, bestie!! brought to you by Simple Directmedia Layer, running SDL 3.4.18, and this lil page is literally titled SDL_VERSIONNUM_MICRO(3). mwah, go forth and extract micros πŸ’…πŸ’œπŸ¦‹

πŸ“¦ where this page comes from