1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Avoid std::strstream, fix the clang build

According https://en.cppreference.com/w/cpp/io/strstream, it has been
deprecated since C++98! The Clang + Linux build systems to not have it
at all, or at least be hiding it.

We can just use `std::stringstream` instead, I think.
This commit is contained in:
John Ericson 2023-12-08 13:18:52 -05:00
parent f0ac2a35d5
commit f9ee1bedcf

View file

@ -28,7 +28,7 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <fstream> #include <fstream>
#include <functional> #include <functional>
#include <strstream> #include <sstream>
#include <sys/resource.h> #include <sys/resource.h>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
@ -2691,7 +2691,7 @@ void EvalState::printStatistics()
std::string ExternalValueBase::coerceToString(const Pos & pos, NixStringContext & context, bool copyMore, bool copyToStore) const std::string ExternalValueBase::coerceToString(const Pos & pos, NixStringContext & context, bool copyMore, bool copyToStore) const
{ {
std::strstream printed; std::stringstream printed;
print(printed); print(printed);
throw TypeError({ throw TypeError({
.msg = hintfmt("cannot coerce %1% to a string: %2%", showType(), printed.str()) .msg = hintfmt("cannot coerce %1% to a string: %2%", showType(), printed.str())