forked from Lainports/freebsd-ports
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
11 lines
594 B
C++
11 lines
594 B
C++
--- 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) {
|