From: Stephen Sinclair Date: Wed, 18 Oct 2017 15:00:00 +0000 (-0300) Subject: Fix compilation of ASIO and WASAPI backends in MingW/Ubuntu. X-Git-Url: https://main.carlh.net/gitweb/?p=rtaudio-cdist.git;a=commitdiff_plain;h=3b1331c16ed513ec92f41d13692bcbe1792c3d1a Fix compilation of ASIO and WASAPI backends in MingW/Ubuntu. 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. --- diff --git a/.travis.yml b/.travis.yml index 41f8e6d..c9afc3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Makefile.am b/Makefile.am index ffb1601..f83007c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/RtAudio.cpp b/RtAudio.cpp index d2ac6b9..1110394 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -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."; diff --git a/configure.ac b/configure.ac index 893a71a..991cbec 100644 --- a/configure.ac +++ b/configure.ac @@ -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" ], [