From c69afe49488d81909495f6cef487fb369bf31f49 Mon Sep 17 00:00:00 2001 From: ZuBsPaCe Date: Sat, 3 Oct 2015 00:38:43 +0200 Subject: [PATCH 1/2] Fixes following Visual Studio 2013 compile error on windows: audio_stream_opus.h(57) : error C2864: 'AudioStreamPlaybackOpus::osrate' : a static data member with an in-class initializer must have non-volatile const integral type See: http://stackoverflow.com/questions/2454019/why-arent-static-const-floats-allowed --- drivers/opus/audio_stream_opus.cpp | 2 ++ drivers/opus/audio_stream_opus.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/opus/audio_stream_opus.cpp b/drivers/opus/audio_stream_opus.cpp index be314204534..eb9c81e1521 100644 --- a/drivers/opus/audio_stream_opus.cpp +++ b/drivers/opus/audio_stream_opus.cpp @@ -30,6 +30,8 @@ /*************************************************************************/ #include "audio_stream_opus.h" +const float AudioStreamPlaybackOpus::osrate=48000.0f; + int AudioStreamPlaybackOpus::_op_read_func(void *_stream, unsigned char *_ptr, int _nbytes) { FileAccess *fa=(FileAccess*)_stream; diff --git a/drivers/opus/audio_stream_opus.h b/drivers/opus/audio_stream_opus.h index 5bb838cd314..2f173cc270d 100644 --- a/drivers/opus/audio_stream_opus.h +++ b/drivers/opus/audio_stream_opus.h @@ -54,7 +54,7 @@ class AudioStreamPlaybackOpus : public AudioStreamPlayback { static int _op_seek_func(void *_stream, opus_int64 _offset, int _whence); static int _op_close_func(void *_stream); static opus_int64 _op_tell_func(void *_stream); - static const float osrate=48000.0f; + static const float osrate; String file; int64_t frames_mixed; From d99727d099a3fb689b7828742f659e95f920fb07 Mon Sep 17 00:00:00 2001 From: ZuBsPaCe Date: Sat, 3 Oct 2015 00:42:40 +0200 Subject: [PATCH 2/2] Fixes following Visual Studio 2013 compile error on windows: drivers\opus\celt\bands.c(555) : error C2057: expected constant expression drivers\opus\celt\bands.c(555) : error C2466: cannot allocate an array of constant size 0 drivers\opus\celt\bands.c(555) : error C2133: 'tmp' : unknown size --- drivers/opus/opus_config.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/opus/opus_config.h b/drivers/opus/opus_config.h index e75550409fb..c6470e92c3a 100644 --- a/drivers/opus/opus_config.h +++ b/drivers/opus/opus_config.h @@ -91,8 +91,13 @@ /* This is a build of OPUS */ #define OPUS_BUILD /**/ -/* Use C99 variable-size arrays */ -#define VAR_ARRAYS 1 +#ifndef WIN32 + /* Use C99 variable-size arrays */ + #define VAR_ARRAYS 1 +#else + /* Fixes VS 2013 compile error */ + #define USE_ALLOCA 1 +#endif /* Define to `__inline__' or `__inline' if that's what the C compiler