diff --git a/libpkg/parser/binary.cpp b/libpkg/parser/binary.cpp index 030bf45..82f1367 100644 --- a/libpkg/parser/binary.cpp +++ b/libpkg/parser/binary.cpp @@ -204,7 +204,11 @@ void Binary::load(std::string_view fileContent, std::string_view fileName, std:: { stringstream fileStream(ios_base::in | ios_base::out | ios_base::binary); fileStream.exceptions(ios_base::failbit | ios_base::badbit); +#if defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION) fileStream.rdbuf()->pubsetbuf(const_cast(fileContent.data()), static_cast(fileContent.size())); +#else + fileStream.write(fileContent.data(), static_cast(fileContent.size())); +#endif parse(fileStream, &fileContent); switch (type) { case BinaryType::Pe: