From: Gabriel Mocanu Date: Sat, 27 Nov 2021 07:52:57 +0000 (+0200) Subject: newlib/libc/include/sys/param.h: Check if MIN and MAX definitions are not defined... X-Git-Tag: RELEASE-0.6~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb1eae70ac6e6861e398cd5538b6ffe7d1240daf;p=unikraft%2Flibs%2Fnewlib.git newlib/libc/include/sys/param.h: Check if MIN and MAX definitions are not defined somewhere else. Signed-off-by: Gabriel Mocanu Reviewed-by: Andrei Mutu Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Pull-Request: #14 --- diff --git a/patches/0012-newlib-include-sys-Fix-MAX-and-MIN-redefinition.patch b/patches/0012-newlib-include-sys-Fix-MAX-and-MIN-redefinition.patch new file mode 100644 index 0000000..c37d16e --- /dev/null +++ b/patches/0012-newlib-include-sys-Fix-MAX-and-MIN-redefinition.patch @@ -0,0 +1,30 @@ +From fcb74ab953ddaf786bec94c6fa1ab339e8d2d691 Mon Sep 17 00:00:00 2001 +From: Gabriel Mocanu +Date: Sat, 20 Nov 2021 11:10:12 +0200 +Subject: [PATCH 2/2] newlib/include/sys: Fix MAX and MIN redefinition + +Signed-off-by: Gabriel Mocanu +--- + newlib/libc/include/sys/param.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/newlib/libc/include/sys/param.h b/newlib/libc/include/sys/param.h +index 9a6f115..093f028 100644 +--- a/newlib/libc/include/sys/param.h ++++ b/newlib/libc/include/sys/param.h +@@ -25,8 +25,12 @@ + + #define MAXPATHLEN PATH_MAX + ++#ifndef MAX + #define MAX(a,b) ((a) > (b) ? (a) : (b)) ++#endif ++#ifndef MIN + #define MIN(a,b) ((a) < (b) ? (a) : (b)) ++#endif + + #ifndef howmany + #define howmany(x, y) (((x)+((y)-1))/(y)) +-- +2.27.0 +