Use sinf instead of std::sinf to improve libstdc++ compatibility
libstdc++ does not define std::sinf in <cmath>. See also: https://stackoverflow.com/a/56420862. BUG=b:235200394 Change-Id: Idfb80ac6f54fbf57a20425391b0c4165b7945b2f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306681 Commit-Queue: Li-Yu Yu <aaronyu@google.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40183}
This commit is contained in:
parent
9fa5057eb9
commit
b84fae66db
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "modules/audio_processing/agc2/agc2_testing_common.h"
|
#include "modules/audio_processing/agc2/agc2_testing_common.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <math.h>
|
||||||
|
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
@ -61,7 +61,8 @@ float SineGenerator::operator()() {
|
|||||||
if (x_radians_ >= 2 * kPi) {
|
if (x_radians_ >= 2 * kPi) {
|
||||||
x_radians_ -= 2 * kPi;
|
x_radians_ -= 2 * kPi;
|
||||||
}
|
}
|
||||||
return amplitude_ * std::sinf(x_radians_);
|
// Use sinf instead of std::sinf for libstdc++ compatibility.
|
||||||
|
return amplitude_ * sinf(x_radians_);
|
||||||
}
|
}
|
||||||
|
|
||||||
PulseGenerator::PulseGenerator(float pulse_amplitude,
|
PulseGenerator::PulseGenerator(float pulse_amplitude,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user