2
0
mirror of https://github.com/gentoo-mirror/gentoo.git synced 2026-01-19 00:09:37 +03:00

dev-perl/Ogg-Vorbis-Header: fix modern C issues

Closes: https://bugs.gentoo.org/883703
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-11-26 03:19:14 +00:00
parent ab695efb8c
commit f3200404d3
2 changed files with 76 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -19,6 +19,7 @@ RDEPEND="
media-libs/libogg
media-libs/libvorbis
"
BDEPEND="${RDEPEND}
virtual/perl-ExtUtils-MakeMaker
"
PATCHES=(
"${FILESDIR}"/${PN}-0.110.0-c99.patch
)

View File

@@ -0,0 +1,71 @@
https://bugs.gentoo.org/883703
https://cgit.freebsd.org/ports/commit/?id=082c2a33647f8921c7bf815a02c9bd62eeb91a08
https://github.com/freebsd/freebsd-ports/commit/082c2a33647f8921c7bf815a02c9bd62eeb91a08
--- a/lib/Ogg/Vorbis/Header.pm
+++ b/lib/Ogg/Vorbis/Header.pm
@@ -7,8 +7,9 @@ use warnings;
our $VERSION = '0.11';
use Inline C => 'DATA',
+ CC => $ENV{CC},
+ CCFLAGSEX => '-Wno-compound-token-split-by-macro',
LIBS => '-logg -lvorbis -lvorbisfile',
- INC => '-I/inc',
AUTO_INCLUDE => '#include "inc/vcedit.h"',
AUTO_INCLUDE => '#include "inc/vcedit.c"',
VERSION => '0.11',
@@ -476,14 +477,14 @@ int write_vorbis (SV *obj)
if ((fd = fopen(inpath, "rb")) == NULL) {
perror("Error opening file in Ogg::Vorbis::Header::write\n");
free(outpath);
- return &PL_sv_undef;
+ return 0;
}
if ((fd2 = fopen(outpath, "w+b")) == NULL) {
perror("Error opening temp file in Ogg::Vorbis::Header::write\n");
fclose(fd);
free(outpath);
- return &PL_sv_undef;
+ return 0;
}
/* Setup the state and comments structs */
@@ -494,7 +495,7 @@ int write_vorbis (SV *obj)
fclose(fd2);
unlink(outpath);
free(outpath);
- return &PL_sv_undef;
+ return 0;
}
vc = vcedit_comments(state);
@@ -526,7 +527,7 @@ int write_vorbis (SV *obj)
vcedit_clear(state);
unlink(outpath);
free(outpath);
- return &PL_sv_undef;
+ return 0;
}
fclose(fd);
@@ -536,7 +537,7 @@ int write_vorbis (SV *obj)
perror("Error copying tempfile in Ogg::Vorbis::Header::add_comment\n");
unlink(outpath);
free(outpath);
- return &PL_sv_undef;
+ return 0;
}
if ((fd2 = fopen(inpath, "wb")) == NULL) {
@@ -544,7 +545,7 @@ int write_vorbis (SV *obj)
fclose(fd);
unlink(outpath);
free(outpath);
- return &PL_sv_undef;
+ return 0;
}
while ((bytes = fread(buffer, 1, BUFFSIZE, fd)) > 0)