Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
audio/p5-Ogg-Vorbis-Header: unbreak the port's build against Clang 16
write_vorbis() must return an integer, but was returning &PL_sv_undef in several places vs. zero in other error paths. Follow the original* implementation and replace those with zeros as well. To make hunting potential compiler-related bugs easier in the future, respect ${CC} and mute one harmless but particularly annoying warning which clutters the build log way more than does any good. *) https://www.perlmonks.org/?node_id=200588
- Loading branch information
Alexey Dokuchaev
authored and
Alexey Dokuchaev
committed
Sep 24, 2023
1 parent
d4ae091
commit 082c2a3
Showing
3 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
audio/p5-Ogg-Vorbis-Header/files/patch-lib_Ogg_Vorbis_Header.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- lib/Ogg/Vorbis/Header.pm.orig 2021-01-04 13:38:15 UTC | ||
+++ 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Fetch/manipulate from Ogg-Vorbis audio files. | ||
Perl module to fetch and manipulate information from Ogg-Vorbis audio files. |