Submitted By:            Douglas R. Reno <renodr at linuxfromscratch dot org>
Date:                    2021-05-26
Initial Package Version: 1.20.0
Upstream Status:         Applied
Origin:                  Upstream (thanks to Joe Locash for reporting)
Description:             Fixes building v4l-utils-1.20.0 with GCC-11.1
                         when Qt5 is installed.

diff -Naurp v4l-utils-1.20.0.orig/utils/common/v4l2-tpg.h v4l-utils-1.20.0/utils/common/v4l2-tpg.h
--- v4l-utils-1.20.0.orig/utils/common/v4l2-tpg.h	2019-09-01 07:41:14.000000000 -0500
+++ v4l-utils-1.20.0/utils/common/v4l2-tpg.h	2021-05-26 12:01:41.783470505 -0500
@@ -26,12 +26,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))
 
