[opus] MSVC compatibility patch for current master branch

Joshua Bowman silverbacknet at gmail.com
Tue Oct 23 11:32:07 PDT 2012


-- 
Joshua Bowman
Silverback Networks
(559) 305-3770
silverbacknet at gmail.com
www.silverbacknetworks.net

-------------- next part --------------
 src/analysis.c                |  6 +++---
 src/mlp.c                     |  3 +++
 src/opus.vcxproj              |  5 +++++
 src/opus.vcxproj.filters      | 15 +++++++++++++++
 src/opus_demo.vcxproj         |  4 ++++
 src/opus_demo.vcxproj.filters | 12 ++++++++++++
 6 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/analysis.c b/src/analysis.c
index 48832d5..b3be892 100644
--- a/src/analysis.c
+++ b/src/analysis.c
@@ -142,9 +142,9 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
     const kiss_fft_state *kfft;
     kiss_fft_cpx in[480], out[480];
     int N = 480, N2=240;
-    float * restrict A = tonal->angle;
-    float * restrict dA = tonal->d_angle;
-    float * restrict d2A = tonal->d2_angle;
+    float * OPUS_RESTRICT A = tonal->angle;
+    float * OPUS_RESTRICT dA = tonal->d_angle;
+    float * OPUS_RESTRICT d2A = tonal->d2_angle;
     float tonality[240];
     float noisiness[240];
     float band_tonality[NB_TBANDS];
diff --git a/src/mlp.c b/src/mlp.c
index f5f3481..32380fd 100644
--- a/src/mlp.c
+++ b/src/mlp.c
@@ -25,6 +25,9 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <math.h>
 #include "mlp.h"
diff --git a/src/opus.vcxproj b/src/opus.vcxproj
index a04d4c6..9b453bc 100644
--- a/src/opus.vcxproj
+++ b/src/opus.vcxproj
@@ -191,6 +191,9 @@
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="analysis.c" />
+    <ClCompile Include="mlp.c" />
+    <ClCompile Include="mlp_data.c" />
     <ClCompile Include="opus.c" />
     <ClCompile Include="opus_decoder.c" />
     <ClCompile Include="opus_encoder.c" />
@@ -210,6 +213,8 @@
     <ClInclude Include="..\include\opus_types.h" />
     <ClInclude Include="..\include\opus_multistream.h" />
     <ClInclude Include="..\win32\config.h" />
+    <ClInclude Include="analysis.h" />
+    <ClInclude Include="mlp.h" />
     <ClInclude Include="opus_private.h" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/src/opus.vcxproj.filters b/src/opus.vcxproj.filters
index 1d1cd84..93d7a09 100644
--- a/src/opus.vcxproj.filters
+++ b/src/opus.vcxproj.filters
@@ -30,6 +30,15 @@
     <ClCompile Include="opus_multistream.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="analysis.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mlp.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mlp_data.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\win32\config.h">
@@ -71,5 +80,11 @@
     <ClInclude Include="..\include\opus_multistream.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="analysis.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mlp.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/src/opus_demo.vcxproj b/src/opus_demo.vcxproj
index 4bbea68..d17bef2 100644
--- a/src/opus_demo.vcxproj
+++ b/src/opus_demo.vcxproj
@@ -11,6 +11,8 @@
     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="analysis.c" />
+    <ClCompile Include="mlp.c" />
     <ClCompile Include="opus.c" />
     <ClCompile Include="opus_decoder.c" />
     <ClCompile Include="opus_demo.c" />
@@ -30,6 +32,8 @@
     <ClInclude Include="..\include\opus_defines.h" />
     <ClInclude Include="..\include\opus_types.h" />
     <ClInclude Include="..\win32\config.h" />
+    <ClInclude Include="analysis.h" />
+    <ClInclude Include="mlp.h" />
     <ClInclude Include="opus_private.h" />
   </ItemGroup>
   <PropertyGroup Label="Globals">
diff --git a/src/opus_demo.vcxproj.filters b/src/opus_demo.vcxproj.filters
index 3e1ef57..e102e1e 100644
--- a/src/opus_demo.vcxproj.filters
+++ b/src/opus_demo.vcxproj.filters
@@ -33,6 +33,12 @@
     <ClCompile Include="opus_demo.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="analysis.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mlp.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\celt\arch.h">
@@ -71,5 +77,11 @@
     <ClInclude Include="..\celt\os_support.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="analysis.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mlp.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file


More information about the opus mailing list