Avoid redefining min and max on Haiku
This commit is contained in:
parent
fa665e06f0
commit
17dfb423b8
2 changed files with 4 additions and 2 deletions
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __HAIKU__
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
// This version has strict type checking for safety.
|
// This version has strict type checking for safety.
|
||||||
// See the "unnecessary" pointer comparison. (from Linux)
|
// See the "unnecessary" pointer comparison. (from Linux)
|
||||||
|
|
@ -76,6 +76,7 @@
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* Not Haiku */
|
||||||
|
|
||||||
#define clamp(lo,value,hi) (min(max(value,lo),hi))
|
#define clamp(lo,value,hi) (min(max(value,lo),hi))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
/* min() and max() variable comparisons: */
|
/* min() and max() variable comparisons: */
|
||||||
|
|
||||||
|
#ifndef __HAIKU__
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
// This version has strict type checking for safety.
|
// This version has strict type checking for safety.
|
||||||
// See the "unnecessary" pointer comparison. (from Linux)
|
// See the "unnecessary" pointer comparison. (from Linux)
|
||||||
|
|
@ -27,7 +28,7 @@
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* Not Haiku */
|
||||||
|
|
||||||
/* clamp() returns 'value', unless it's less than 'lo' or greater than 'hi',
|
/* clamp() returns 'value', unless it's less than 'lo' or greater than 'hi',
|
||||||
in which cases it returns 'lo' or 'hi', respectively: */
|
in which cases it returns 'lo' or 'hi', respectively: */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue