diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-03-15 08:13:14 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-03-15 08:20:09 +0100 |
commit | 02f295d4c4c1b401cdb589df5bef2645c7f83813 (patch) | |
tree | 85f250ff9fa5653a15fdd2628990c23a25ccedb4 | |
parent | e78f2c82fdcdd648aa3b8570c14202fef2628cd9 (diff) | |
download | v4l-utils-02f295d4c4c1b401cdb589df5bef2645c7f83813.tar.gz |
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>
-rw-r--r-- | utils/common/v4l2-tpg.h | 10 | ||||
-rw-r--r-- | 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)) diff --git a/utils/common/v4l2-tpg.patch b/utils/common/v4l2-tpg.patch index f7c9f86b..2381ebd9 100644 --- a/utils/common/v4l2-tpg.patch +++ b/utils/common/v4l2-tpg.patch @@ -167,7 +167,7 @@ diff --git a/utils/common/v4l2-tpg.h b/utils/common/v4l2-tpg.h index 0b0ddb87..91da74ec 100644 --- a/utils/common/v4l2-tpg.h +++ b/utils/common/v4l2-tpg.h -@@ -8,13 +8,61 @@ +@@ -8,13 +8,59 @@ #ifndef _V4L2_TPG_H_ #define _V4L2_TPG_H_ @@ -196,12 +196,10 @@ index 0b0ddb87..91da74ec 100644 +#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)) + |