SDL_ASSERT_CAPABILITY(3)

πŸ’– SDL_ASSERT_CAPABILITY(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_ASSERT_CAPABILITY β€” she's a lil macro wrapper around Clang's thread safety analysis annotations, and she's lowkey carrying the whole "is this mutex even held rn" agenda. πŸŽ€


✨ NAME ✨

SDL_ASSERT_CAPABILITY β€” a wrapper around Clang thread safety analysis annotations. that's it, that's the vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_mutex.h>

#define SDL_ASSERT_CAPABILITY(x) \
  SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))

like. look at her. one macro, one argument, zero drama. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

fr fr, the actual lore lives here, so go read it:

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

that's the whole description bestie, no cap β€” the Clang docs are the source of truth and we're just the messenger 🫢


🌈 AVAILABILITY 🌈

this macro has been serving since SDL 3.2.0 ✨ so if you're on anything older, she is not in the building. πŸ’€


ngl if you're out here holding a mutex with no annotation and wondering why Clang is judging you... she noticed. she always notices. πŸ‘‘

mwah πŸ’‹ thanks for reading, bestie β€” this page came to you from Simple Directmedia Layer, SDL 3.4.18, and yes she's an SDL_ASSERT_CAPABILITY(3) girlie. stan. 🌟

πŸ“¦ where this page comes from