include: Fixed up some more documentation.

This commit is contained in:
Ryan C. Gordon 2024-04-10 15:58:16 -04:00
parent b33420cac7
commit 557f26e6f0
No known key found for this signature in database
GPG key ID: FA148B892AB48044
2 changed files with 157 additions and 7 deletions

View file

@ -338,20 +338,38 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
*/
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
#ifndef SDL_AtomicIncRef
/**
* Increment an atomic variable used as a reference count.
*
* ***Note: If you don't know what this macro is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicInt to increment.
* \returns the previous value of the atomic variable.
*
* \since This macro is available since SDL 3.0.0.
*
* \sa SDL_AtomicDecRef
*/
#ifndef SDL_AtomicIncRef
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
#endif
#ifndef SDL_AtomicDecRef
/**
* Decrement an atomic variable used as a reference count.
*
* \return SDL_TRUE if the variable reached zero after decrementing,
* SDL_FALSE otherwise
* ***Note: If you don't know what this macro is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_AtomicInt to increment.
* \returns SDL_TRUE if the variable reached zero after decrementing,
* SDL_FALSE otherwise
*
* \since This macro is available since SDL 3.0.0.
*
* \sa SDL_AtomicIncRef
*/
#ifndef SDL_AtomicDecRef
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
#endif