common.h: define MIN and MAX macro only if nod defined yet (#1896)
This fix compilation error for Kinetis and Cypress if common.h is included after platform includes which also defines MIN MAX.
This commit is contained in:
parent
2a8a0f6af1
commit
4c074fb9c8
|
@ -22,8 +22,12 @@
|
|||
#ifndef COMMON_H_INCLUDED
|
||||
#define COMMON_H_INCLUDED
|
||||
|
||||
#if !defined(MIN)
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
#if !defined(MAX)
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#define CLAMP(x, low, high) ({\
|
||||
__typeof__(x) __x = (x); \
|
||||
|
|
Loading…
Reference in New Issue