commit:     84011e51778257bb65cfce4adde9833f64ed596c
Author:     x7upLime <andrew <AT> andrewdomain <DOT> com>
AuthorDate: Thu Jul 20 23:09:47 2023 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Sat Jul 22 06:37:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84011e51

media-sound/audacious: VFS_SEEK enum backporting

backported from:
https://github.com/audacious-media-player/audacious/pull/64

Closes: https://bugs.gentoo.org/896412
Signed-off-by: Andrei Corduneanu <andrew <AT> andrewdomain.com>
Closes: https://github.com/gentoo/gentoo/pull/31980
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 media-sound/audacious/audacious-4.3.1.ebuild       |  4 +++
 .../files/audacious-enum-backporting.patch         | 35 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/media-sound/audacious/audacious-4.3.1.ebuild 
b/media-sound/audacious/audacious-4.3.1.ebuild
index ee999ce83200..591c2b60ab94 100644
--- a/media-sound/audacious/audacious-4.3.1.ebuild
+++ b/media-sound/audacious/audacious-4.3.1.ebuild
@@ -33,6 +33,10 @@ PDEPEND="~media-plugins/audacious-plugins-${PV}"
 
 S="${WORKDIR}/${MY_P}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-enum-backporting.patch
+)
+
 src_prepare() {
        default
        if ! use nls; then

diff --git a/media-sound/audacious/files/audacious-enum-backporting.patch 
b/media-sound/audacious/files/audacious-enum-backporting.patch
new file mode 100644
index 000000000000..66bb959f737e
--- /dev/null
+++ b/media-sound/audacious/files/audacious-enum-backporting.patch
@@ -0,0 +1,35 @@
+From 3989bafcb7a8843cef4e25875cd6c0e72680ad80 Mon Sep 17 00:00:00 2001
+From: Guido Falsi <[email protected]>
+Date: Wed, 28 Jun 2023 15:42:37 +0200
+Subject: [PATCH] Add missing enum value.
+
+New versions of the clang compiler have strict checks for enum values.
+
+The value "-1" is returned as a last resort from to_vfs_seek_type() as a 
VFSSeekType.
+
+Replace usage of `-1` with the new enum name.
+---
+ src/libaudcore/vfs.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/libaudcore/vfs.h b/src/libaudcore/vfs.h
+index 33c5a65c97..f6a1dd3f23 100644
+--- a/src/libaudcore/vfs.h
++++ b/src/libaudcore/vfs.h
+@@ -51,6 +51,7 @@ enum VFSReadOptions
+ 
+ enum VFSSeekType
+ {
++    VFS_SEEK_INVALID = -1,
+     VFS_SEEK_SET = 0,
+     VFS_SEEK_CUR = 1,
+     VFS_SEEK_END = 2
+@@ -75,7 +76,7 @@ constexpr VFSSeekType to_vfs_seek_type(int whence)
+                ? VFS_SEEK_SET
+                : (whence == SEEK_CUR)
+                      ? VFS_SEEK_CUR
+-                     : (whence == SEEK_END) ? VFS_SEEK_END : (VFSSeekType)-1;
++                     : (whence == SEEK_END) ? VFS_SEEK_END : VFS_SEEK_INVALID;
+ }
+ 
+ #endif // WANT_VFS_STDIO_COMPAT

Reply via email to