Skip to content

Commit cb1eae7

Browse files
gabrielmocanuunikraft-bot
authored andcommitted
newlib/libc/include/sys/param.h: Check if MIN and MAX definitions are not defined somewhere else.
Signed-off-by: Gabriel Mocanu <[email protected]> Reviewed-by: Andrei Mutu <[email protected]> Approved-by: Razvan Deaconescu <[email protected]> Tested-by: Unikraft CI <[email protected]> GitHub-Pull-Request: unikraft#14
1 parent 286d5b8 commit cb1eae7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From fcb74ab953ddaf786bec94c6fa1ab339e8d2d691 Mon Sep 17 00:00:00 2001
2+
From: Gabriel Mocanu <[email protected]>
3+
Date: Sat, 20 Nov 2021 11:10:12 +0200
4+
Subject: [PATCH 2/2] newlib/include/sys: Fix MAX and MIN redefinition
5+
6+
Signed-off-by: Gabriel Mocanu <[email protected]>
7+
---
8+
newlib/libc/include/sys/param.h | 4 ++++
9+
1 file changed, 4 insertions(+)
10+
11+
diff --git a/newlib/libc/include/sys/param.h b/newlib/libc/include/sys/param.h
12+
index 9a6f115..093f028 100644
13+
--- a/newlib/libc/include/sys/param.h
14+
+++ b/newlib/libc/include/sys/param.h
15+
@@ -25,8 +25,12 @@
16+
17+
#define MAXPATHLEN PATH_MAX
18+
19+
+#ifndef MAX
20+
#define MAX(a,b) ((a) > (b) ? (a) : (b))
21+
+#endif
22+
+#ifndef MIN
23+
#define MIN(a,b) ((a) < (b) ? (a) : (b))
24+
+#endif
25+
26+
#ifndef howmany
27+
#define howmany(x, y) (((x)+((y)-1))/(y))
28+
--
29+
2.27.0
30+

0 commit comments

Comments
 (0)