Fix compilation of ASIO and WASAPI backends in MingW/Ubuntu.
authorStephen Sinclair <radarsat1@gmail.com>
Wed, 18 Oct 2017 15:00:00 +0000 (12:00 -0300)
committerStephen Sinclair <radarsat1@gmail.com>
Wed, 18 Oct 2017 20:33:01 +0000 (17:33 -0300)
Warnings/errors "unused function" are from the unicode conversion
functions on Windows, and "unused but set variable" is from ASIO
source code; we disable these warnings on Windows builds.

.travis.yml
Makefile.am
RtAudio.cpp
configure.ac

index 41f8e6d96855c8e65f8ec9eeb7e38a848ab57bc3..c9afc3a2f688db04c227bbf735f5346dfe713d8f 100644 (file)
@@ -30,28 +30,28 @@ matrix:
     env: HOST="" API="oss"
     compiler: clang
   - os: linux
-    env: HOST="--host=i686-w64-mingw32" API="winmm"
+    env: HOST="--host=i686-w64-mingw32" API="winmm" CPPFLAGS="-Wno-unused-function"
     compiler: gcc
   - os: linux
-    env: HOST="--host=x86_64-w64-mingw32" API="winmm"
+    env: HOST="--host=x86_64-w64-mingw32" API="winmm" CPPFLAGS="-Wno-unused-function"
     compiler: gcc
   - os: linux
-    env: HOST="--host=i686-w64-mingw32" API="dsound"
+    env: HOST="--host=i686-w64-mingw32" API="dsound" CPPFLAGS="-Wno-unused-function"
     compiler: gcc
   - os: linux
-    env: HOST="--host=x86_64-w64-mingw32" API="dsound"
+    env: HOST="--host=x86_64-w64-mingw32" API="dsound" CPPFLAGS="-Wno-unused-function"
     compiler: gcc
   - os: linux
-    env: HOST="--host=i686-w64-mingw32" API="asio"
+    env: HOST="--host=i686-w64-mingw32" API="asio" CPPFLAGS="-Wno-unused-function -Wno-unused-but-set-variable"
     compiler: gcc
   - os: linux
-    env: HOST="--host=x86_64-w64-mingw32" API="asio"
+    env: HOST="--host=x86_64-w64-mingw32" API="asio" CPPFLAGS="-Wno-unused-function -Wno-unused-but-set-variable"
     compiler: gcc
   - os: linux
-    env: HOST="--host=i686-w64-mingw32" API="wasapi"
+    env: HOST="--host=i686-w64-mingw32" API="wasapi" CPPFLAGS="-Wno-unused-function"
     compiler: gcc
   - os: linux
-    env: HOST="--host=x86_64-w64-mingw32" API="wasapi"
+    env: HOST="--host=x86_64-w64-mingw32" API="wasapi" CPPFLAGS="-Wno-unused-function"
     compiler: gcc
   # jack and asound not found on ARM gnueabihf
   # - os: linux
index ffb16013c92c4d5cbbb9a431eed01214105f8f07..f83007ccf19474c54b969ab1db0b31b05043a481 100644 (file)
@@ -13,10 +13,10 @@ lib_LTLIBRARIES = %D%/librtaudio.la
 
 if ASIO
 %C%_librtaudio_la_SOURCES += \
-       asio.cpp \
-       asiodrivers.cpp \
-       asiolist.cpp \
-       iasiothiscallresolver.cpp
+       include/asio.cpp \
+       include/asiodrivers.cpp \
+       include/asiolist.cpp \
+       include/iasiothiscallresolver.cpp
 endif
 
 rtaudio_incdir = $(includedir)/rtaudio
index d2ac6b9b4ca0c642b9eb6b227c8bc877d5331d56..111039404af9339ab508a4efcfda6458788c6d33 100644 (file)
@@ -4458,7 +4458,7 @@ bool RtApiWasapi::probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
   if ( sampleRate != deviceInfo.preferredSampleRate )
   {
     errorType = RtAudioError::INVALID_USE;
-    std::stringstring ss;
+    std::stringstream ss;
     ss << "RtApiWasapi::probeDeviceOpen: " << sampleRate
        << "Hz sample rate not supported. This device only supports "
        << deviceInfo.preferredSampleRate << "Hz.";
index 893a71a4c2d0cd1ad952039a27a39099abd7c8b0..991cbecdf64af4b62cea3494fb762d6220256ee8 100644 (file)
@@ -226,6 +226,7 @@ AS_CASE([$host],
     AC_MSG_RESULT([using ASIO])
     api="$api -D__WINDOWS_ASIO__"
     use_asio=yes
+    CPPFLAGS="-I$srcdir/include $CPPFLAGS"
   ])
   # Look for DirectSound flag
   AS_IF([test "x$with_ds" = "xyes" ], [
@@ -238,6 +239,7 @@ AS_CASE([$host],
     AC_MSG_RESULT([using WASAPI])
     api="$api -D__WINDOWS_WASAPI__"
     LIBS="-lwinmm -luuid -lksuser $LIBS"
+    CPPFLAGS="-I$srcdir/include $CPPFLAGS"
   ])
   # If no audio api flags specified, use DS
   AS_IF([test "x$api" = "x" ], [