PKGBUILDs/extra/v4l-utils/0001-v4l2-tpg.patch-rename-min-max-defines-to-tpg_min-max.patch
2021-10-31 17:46:23 +00:00

36 lines
1.4 KiB
Diff

From 02f295d4c4c1b401cdb589df5bef2645c7f83813 Mon Sep 17 00:00:00 2001
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Date: Mon, 15 Mar 2021 08:13:14 +0100
Subject: [PATCH] v4l2-tpg.patch: rename min/max defines to tpg_min/max
With gcc 11 the min/max defines clash with what gcc provides,
so rename these defines. They are only used in the min3/max3
defines, so the change it kept to a minimum.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Gregor Jasny <gjasny@googlemail.com>
---
utils/common/v4l2-tpg.h | 10 ++++------
utils/common/v4l2-tpg.patch | 12 +++++-------
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/utils/common/v4l2-tpg.h b/utils/common/v4l2-tpg.h
index caf7b1a1..ecdb6eba 100644
--- a/utils/common/v4l2-tpg.h
+++ b/utils/common/v4l2-tpg.h
@@ -28,12 +28,10 @@ typedef __s8 s8;
#define pr_info printf
#define noinline
-#ifndef min
-#define min(a,b) ((a) < (b) ? (a) : (b))
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#endif /* !min */
-#define min3(x, y, z) min((typeof(x))min(x, y), z)
-#define max3(x, y, z) max((typeof(x))max(x, y), z)
+#define tpg_min(a,b) ((a) < (b) ? (a) : (b))
+#define tpg_max(a,b) ((a) > (b) ? (a) : (b))
+#define min3(x, y, z) tpg_min((typeof(x))tpg_min(x, y), z)
+#define max3(x, y, z) tpg_max((typeof(x))tpg_max(x, y), z)
#define array_size(a, b) ((a) * (b))
#define array3_size(a, b, c) ((a) * (b) * (c))