From 4c074fb9c85fe07c983373f41f727aac29761973 Mon Sep 17 00:00:00 2001 From: Andrey G Date: Thu, 22 Oct 2020 15:41:44 +0300 Subject: [PATCH] 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. --- firmware/util/common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/util/common.h b/firmware/util/common.h index 0ae45ad87d..5fa2d1cd10 100644 --- a/firmware/util/common.h +++ b/firmware/util/common.h @@ -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); \