From b763cbabfe79b4fcaba6a9cf44ba9169ca09598d Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Fri, 4 Mar 2022 21:36:45 -0500 Subject: [PATCH] Fix build. --- src/ConfigMain.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ConfigMain.cpp b/src/ConfigMain.cpp index 0f20353..67c98e5 100644 --- a/src/ConfigMain.cpp +++ b/src/ConfigMain.cpp @@ -32,6 +32,8 @@ #include #include "JackServerSettings.hpp" +#define SS(x) ( ((std::stringstream&)(std::stringstream() << x )).str()) + using namespace std; using namespace pipedal; @@ -196,7 +198,7 @@ static void RemoveLine(const std::string&path, const std::string lineToRemove) ifstream f(path); if (!f.is_open()) { - throw PiPedalException((std::stringstream() << "Can't open " << path).str()); + throw PiPedalException(SS("Can't open " << path)); } while (true) { @@ -215,7 +217,7 @@ static void RemoveLine(const std::string&path, const std::string lineToRemove) std::ofstream f(path); if (!f.is_open()) { - throw PiPedalException("Can't write to file."); + throw PiPedalException(SS("Can't write to " << path)); } for (auto&line: lines) { @@ -251,7 +253,7 @@ void InstallPamEnv() ifstream f(path); if (!f.is_open()) { - throw PiPedalException((std::stringstream() << "Can't open " << path).str()); + throw PiPedalException(SS("Can't open " << path)); } while (true) { @@ -276,7 +278,7 @@ void InstallPamEnv() std::ofstream f(path); if (!f.is_open()) { - throw PiPedalException("Can't write to file."); + throw PiPedalException(SS("Can't write to " << path)); } for (auto&line: lines) {