summaryrefslogtreecommitdiff
path: root/media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-18 00:29:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-18 00:29:05 +0000
commit467e2131896a3030032cd5b0fab2094a045bf9d0 (patch)
tree534578ca7ef61b3eb30fee861db78c0ae58e2fa6 /media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch
parent1f254b1ee917690b4f8f7738fdcfc295ee304ff7 (diff)
gentoo auto-resync : 18:03:2023 - 00:29:05
Diffstat (limited to 'media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch')
-rw-r--r--media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch b/media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch
new file mode 100644
index 000000000000..e21d38b311e9
--- /dev/null
+++ b/media-gfx/gphoto2/files/gphoto2-2.5.28-clang-16.patch
@@ -0,0 +1,77 @@
+https://bugs.gentoo.org/896212
+https://github.com/gphoto/gphoto2/pull/569
+https://github.com/gphoto/gphoto2/commit/ccc4c1f092bd21ebc713f4d7b9be85be49f92f1e
+https://github.com/gphoto/gphoto2/commit/366930ccc1a261c3eb883da2bf3c655162ccd75f
+
+From ccc4c1f092bd21ebc713f4d7b9be85be49f92f1e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Sep 2022 12:59:46 -0700
+Subject: [PATCH] gphoto2: Use pthread_t abstract type for thead IDs
+
+This is not a plain old datatype in every libc, e.g. with musl this
+would fail in type conversion
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/gphoto2/main.c
++++ b/gphoto2/main.c
+@@ -1198,7 +1198,7 @@ thread_func (void *data)
+ pthread_cleanup_pop (1);
+ }
+
+-static unsigned int
++static pthread_t
+ start_timeout_func (Camera *camera, unsigned int timeout,
+ CameraTimeoutFunc func, void __unused__ *data)
+ {
+@@ -1219,7 +1219,7 @@ start_timeout_func (Camera *camera, unsigned int timeout,
+ }
+
+ static void
+-stop_timeout_func (Camera __unused__ *camera, unsigned int id,
++stop_timeout_func (Camera __unused__ *camera, pthread_t id,
+ void __unused__ *data)
+ {
+ pthread_t tid = id;
+
+
+From 366930ccc1a261c3eb883da2bf3c655162ccd75f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 1 Mar 2023 22:58:37 -0800
+Subject: [PATCH] Match prototypes of callbacks with libgphoto
+
+In https://github.com/gphoto/gphoto2/pull/535/commits/ccc4c1f092bd21ebc713f4d7b9be85be49f92f1e
+we tried to fix by using pthread_t but it also needs to make changes in
+libgphoto and these changes can be invasive, therefore lets revert to
+older types and to fix musl problem fix it via type casts
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/gphoto2/main.c
++++ b/gphoto2/main.c
+@@ -1198,7 +1198,7 @@ thread_func (void *data)
+ pthread_cleanup_pop (1);
+ }
+
+-static pthread_t
++static unsigned int
+ start_timeout_func (Camera *camera, unsigned int timeout,
+ CameraTimeoutFunc func, void __unused__ *data)
+ {
+@@ -1215,14 +1215,14 @@ start_timeout_func (Camera *camera, unsigned int timeout,
+
+ pthread_create (&tid, NULL, thread_func, td);
+
+- return (tid);
++ return (unsigned int)tid;
+ }
+
+ static void
+-stop_timeout_func (Camera __unused__ *camera, pthread_t id,
++stop_timeout_func (Camera __unused__ *camera, unsigned int id,
+ void __unused__ *data)
+ {
+- pthread_t tid = id;
++ pthread_t tid = (pthread_t)id;
+
+ pthread_cancel (tid);
+ pthread_join (tid, NULL);
+