diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-08-24 21:17:22 +0200 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-14 13:08:21 +0100 |
commit | adbc9aa457563f7892653bf2d8cb4a60d0f13662 (patch) | |
tree | e58872401ccf2233438b469de84f39ae87cc1001 | |
parent | 0b714343b0000a9a4c34645f5b8b9c1cbb370ab2 (diff) |
av: Fix build in ISO C++11 mode
Change-Id: I461d8ce5b24afedee245a6441b600df286c76b63
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | services/audioflinger/AudioResampler.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h index 2b8694f1..cb0259a6 100644 --- a/services/audioflinger/AudioResampler.h +++ b/services/audioflinger/AudioResampler.h @@ -22,6 +22,10 @@ #include <media/AudioBufferProvider.h> +#if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(constexpr) +#define constexpr const +#endif + namespace android { // ---------------------------------------------------------------------------- @@ -66,13 +70,13 @@ public: protected: // number of bits for phase fraction - 30 bits allows nearly 2x downsampling - static const int kNumPhaseBits = 30; + static constexpr int kNumPhaseBits = 30; // phase mask for fraction - static const uint32_t kPhaseMask = (1LU<<kNumPhaseBits)-1; + static constexpr uint32_t kPhaseMask = (1LU<<kNumPhaseBits)-1; // multiplier to calculate fixed point phase increment - static const double kPhaseMultiplier = 1L << kNumPhaseBits; + static constexpr double kPhaseMultiplier = 1L << kNumPhaseBits; AudioResampler(int bitDepth, int inChannelCount, int32_t sampleRate, src_quality quality); |