SDL_FORCE_INLINE(3)

πŸ’– SDL_FORCE_INLINE(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_FORCE_INLINE 🫢


✨ NAME ✨

SDL_FORCE_INLINE β€” a macro that literally demands a function get inlined. no asking nicely, no suggestions, it's giving "you WILL be inlined" πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_begin_code.h>

#define SDL_FORCE_INLINE __forceinline

πŸ¦‹ DESCRIPTION πŸ¦‹

So what is this? It's a lil command you hand to your compiler saying "hey, inline this function, k thanks" ✨ SDL uses this macro all up in its public headers for a handful of simple functions β€” just a few, the lowkey easy ones, you know the vibe.

Now here's the tea 🍡: on compilers that don't support forceinline at all, this macro gets defined to static SDL_INLINE instead, which β€” ngl β€” is often good enough. not iconic, but it works πŸ’€

This symbol is used in SDL's headers, but apps and other libraries are totally welcome to use it for their own interfaces as well. it's not gatekept, it's community property, we love to see it πŸ₯°


πŸ’œ AVAILABILITY πŸ’œ

This macro has been available since SDL 3.2.0. so if you're on anything older… girl, upgrade 😭


fr fr: it's just a macro. but it's a macro with main character energy πŸ‘‘

Simple Directmedia Layer β€” SDL 3.4.18 β€” that's the source and the version, bestie, straight from the SDL_FORCE_INLINE(3) page itself 🌈

stay inlined, stay slay, mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from