From 3aaf515950b7377567fa7ef40fa4d1a0067b0d41 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 14 Apr 2006 22:47:08 +0000 Subject: [PATCH] work around wxString format oddity (interesting. wx doesn't seem to use swprintf internally.) Originally committed to SVN as r331. --- core/audio_player_portaudio.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/audio_player_portaudio.cpp b/core/audio_player_portaudio.cpp index fcb739673..17f9b7422 100644 --- a/core/audio_player_portaudio.cpp +++ b/core/audio_player_portaudio.cpp @@ -52,8 +52,11 @@ PortAudioPlayer::PortAudioPlayer() { // Initialize portaudio if (!pa_refcount) { PaError err = Pa_Initialize(); - if (err != paNoError) - throw wxString::Format(_T("Failed opening PortAudio with error: %s"), Pa_GetErrorText(err)); + if (err != paNoError) { + static wchar_t errormsg[2048]; + swprintf(errormsg, 2048, L"Failed opening PortAudio: %s", Pa_GetErrorText(err)); + throw (const wchar_t *)errormsg; + } pa_refcount++; }