Clarified that you should never have side-effects in the parameters to SDL_min/SDL_max

This commit is contained in:
Sam Lantinga 2021-08-10 16:51:03 -07:00
parent bb91d7a5ea
commit d5ad6f6e6a

View file

@ -430,8 +430,7 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, in
extern DECLSPEC int SDLCALL SDL_abs(int x); extern DECLSPEC int SDLCALL SDL_abs(int x);
/* !!! FIXME: these have side effects. You probably shouldn't use them. */ /* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */
/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) #define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) #define SDL_max(x, y) (((x) > (y)) ? (x) : (y))