mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-25 07:49:38 +03:00
utils: Add clamp() macro
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
37dfc4a44e
commit
8193a5518e
@ -49,6 +49,10 @@
|
||||
#ifndef max
|
||||
#define max(x,y) (((x)>(y))?(x):(y))
|
||||
#endif
|
||||
|
||||
#ifndef clamp
|
||||
#define clamp(x,low,high) (min(max((x),(low)),(high)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Windows does not have POSIX mkdir so work around that */
|
||||
|
Loading…
Reference in New Issue
Block a user