av: Fix build in ISO C++11 mode
Change-Id: I461d8ce5b24afedee245a6441b600df286c76b63
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h
index 2b8694f..cb0259a 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 @@
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);