SDL_REQUIRES_SHARED(3)

πŸ’– SDL_REQUIRES_SHARED(3) πŸ’–

ok so bestie, welcome to the SDL3 FUNCTIONS corner of the man pages β€” today we're talking about SDL_REQUIRES_SHARED, and it's giving compiler-whisperer energy, no cap 🧚


✨ NAME ✨

SDL_REQUIRES_SHARED β€” a lil wrapper around Clang thread safety analysis annotations πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_mutex.h>

#define SDL_REQUIRES_SHARED(x) \
  SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x))

✨ DESCRIPTION ✨

bestie, this one is short and I'm obsessed with how low-effort it is on my end. The actual lore lives here:

https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#mutex-h

like, go read that, it's the main character of this whole thing πŸ’…


✨ AVAILABILITY ✨

This macro has been around since SDL 3.2.0 β€” so if you're on anything older, she's not there yet, sorry bestie 😭


Simple Directmedia Layer πŸ¦‹ SDL 3.4.18 πŸ¦‹ and that's the whole vibe, mwah πŸ’– go forth and annotate your mutexes, queen πŸ‘‘

πŸ“¦ where this page comes from