Skip to content

Commit

Permalink
fix: avoid using std::format as not supported on all compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
almoghamdani committed Jan 14, 2023
1 parent 7b1b96c commit d6211e7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/rt_audio.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "rt_audio.h"

#include <cmath>
#include <format>
#include <sstream>

#include "rt_audio_converter.h"

Expand Down Expand Up @@ -656,9 +656,13 @@ void RtAudioWrap::checkRtAudio(const RtAudioErrorType error,
return;
}

throw Napi::Error::New(env,
std::format(
"RtAudio Error: Code: {}, Message: '{}'",
static_cast<UINT32>(error),
_rtAudio->getErrorText()));
std::stringstream ss;

ss << "RtAudio Error: Code: ";
ss << static_cast<UINT32>(error);
ss << ", Message: '";
ss << _rtAudio->getErrorText();
ss << "'";

throw Napi::Error::New(env, ss.str());
}

0 comments on commit d6211e7

Please sign in to comment.