Skip to content

Commit 30be0a0

Browse files
committed
sdl2: Allow building with really old SDL2 headers, that lack SDL_clamp.
Fixes #32.
1 parent d515f35 commit 30be0a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mojoal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#include "alc.h"
2828
#include "SDL.h"
2929

30+
/* really old SDL2 headers don't have SDL_clamp. */
31+
#ifndef SDL_clamp
32+
#define SDL_clamp(x, a, b) ((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x))
33+
#endif
34+
3035
/* This is for debugging and/or pulling the fire alarm. */
3136
#define FORCE_SCALAR_FALLBACK 0
3237
#if FORCE_SCALAR_FALLBACK

0 commit comments

Comments
 (0)