This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 61a23596779260d27ffa1291c294ed1745f28f41
Author: wangyongrong <[email protected]>
AuthorDate: Wed Jun 24 17:51:46 2026 +0800

    include/sys/param.h: add MIN3/MAX3 helpers
    
    Add MIN3/MAX3 convenience macros alongside the existing MIN/MAX, for
    bounding a value by three candidates in a single expression.
    
    Signed-off-by: wangyongrong <[email protected]>
    Signed-off-by: Bowen Wang <[email protected]>
---
 include/sys/param.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/sys/param.h b/include/sys/param.h
index c580e5c860e..d4a8cb37173 100644
--- a/include/sys/param.h
+++ b/include/sys/param.h
@@ -62,6 +62,14 @@
 #  define MAX(a,b)      (((a) > (b)) ? (a) : (b))
 #endif  /* MAX */
 
+#ifndef MIN3
+#  define MIN3(a,b,c)   MIN(MIN(a,b),(c))
+#endif  /* MIN3 */
+
+#ifndef MAX3
+#  define MAX3(a,b,c)   MAX(MAX(a,b),(c))
+#endif  /* MAX3 */
+
 #ifndef CLAMP
 /* inclusively clamping a value into a given range */
 #  define CLAMP(x, min, max) ((x) <= (min) ? (min) : MIN(x, max))

Reply via email to