aboutsummaryrefslogtreecommitdiff
path: root/audio/espeak-ng
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-05-18 12:09:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-06-04 16:21:24 +0000
commitc7753b07bba7d1a4d1b60c8e83758ef25d909cc5 (patch)
tree3978a926fe5f379fea141a2a8639d78a80ebabf8 /audio/espeak-ng
parent28b30b0f681fbd8166afda9a633c04d7939ed6d6 (diff)
downloadports-c7753b07bba7d1a4d1b60c8e83758ef25d909cc5.tar.gz
ports-c7753b07bba7d1a4d1b60c8e83758ef25d909cc5.zip
audio/espeak-ng: fix build with clang 16
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17. Because audio/espeak-ng's Makefile does not explicitly set its C++ standard, this leads to an error: src/speechPlayer/src/speechWaveGenerator.cpp:197:56: error: reference to 'sample' is ambiguous unsigned int generate(const unsigned int sampleCount, sample* sampleBuf) { ^ src/speechPlayer/src/sample.h:23:3: note: candidate found by name lookup is 'sample' } sample; ^ /usr/include/c++/v1/__algorithm/sample.h:95:17: note: candidate found by name lookup is 'std::sample' _SampleIterator sample(_PopulationIterator __first, ^ This is because speechWaveGenerator.cpp has "using namespace std;" at the top, so "sample" can match both "std::sample" (from <algorithm>) and "struct sample" (from sample.h). Qualify "sample" as "::sample" to work around the problem. PR: 271486 Approved by: maintainer timeout (2 weeks) MFH: 2023Q2
Diffstat (limited to 'audio/espeak-ng')
-rw-r--r--audio/espeak-ng/Makefile2
-rw-r--r--audio/espeak-ng/files/patch-src_speechPlayer_src_speechWaveGenerator.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/audio/espeak-ng/Makefile b/audio/espeak-ng/Makefile
index 1b5c28c6a07b..a51c5f5045b1 100644
--- a/audio/espeak-ng/Makefile
+++ b/audio/espeak-ng/Makefile
@@ -1,6 +1,6 @@
PORTNAME= espeak-ng
PORTVERSION= 1.51.1
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= audio
#MASTER_SITES= https://github.com/espeak-ng/${PORTNAME}/releases/download/${PORTVERSION}/
diff --git a/audio/espeak-ng/files/patch-src_speechPlayer_src_speechWaveGenerator.cpp b/audio/espeak-ng/files/patch-src_speechPlayer_src_speechWaveGenerator.cpp
new file mode 100644
index 000000000000..19f1081e6c02
--- /dev/null
+++ b/audio/espeak-ng/files/patch-src_speechPlayer_src_speechWaveGenerator.cpp
@@ -0,0 +1,11 @@
+--- src/speechPlayer/src/speechWaveGenerator.cpp.orig 2022-06-21 14:53:53 UTC
++++ src/speechPlayer/src/speechWaveGenerator.cpp
+@@ -194,7 +194,7 @@ class SpeechWaveGeneratorImpl: public SpeechWaveGenera
+ SpeechWaveGeneratorImpl(int sr): sampleRate(sr), voiceGenerator(sr), fricGenerator(), cascade(sr), parallel(sr), frameManager(NULL) {
+ }
+
+- unsigned int generate(const unsigned int sampleCount, sample* sampleBuf) {
++ unsigned int generate(const unsigned int sampleCount, ::sample* sampleBuf) {
+ if(!frameManager) return 0;
+ double val=0;
+ for(unsigned int i=0;i<sampleCount;++i) {