ifndef MIN, MAX and CLAMP
Does make live a lot easier for backends.
This commit is contained in:
parent
ba9ca057f2
commit
aa64398646
10
demo/demo.c
10
demo/demo.c
@ -1,8 +1,14 @@
|
||||
#include "limits.h"
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) < (b) ? (b) : (a))
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) ((a) < (b) ? (b) : (a))
|
||||
#endif
|
||||
#ifndef CLAMP
|
||||
#define CLAMP(i,v,x) (MAX(MIN(v,x), i))
|
||||
#endif
|
||||
#define LEN(a) (sizeof(a)/sizeof(a)[0])
|
||||
#define UNUSED(a) ((void)(a))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user