Improve condition for use of `pubsetbuf`
Using this function like this seems only be possible with `libstdc++`. The standard lib of MSVC does not support it as well. So use it only with `libstdc++`.
This commit is contained in:
parent
7bb9134fd3
commit
92d8324cdc
|
@ -349,10 +349,10 @@ void PasswordFile::load()
|
|||
stringstream decryptedStream(stringstream::in | stringstream::out | stringstream::binary);
|
||||
decryptedStream.exceptions(ios_base::failbit | ios_base::badbit);
|
||||
try {
|
||||
#ifdef _LIBCPP_VERSION
|
||||
decryptedStream.write(decryptedData.data(), static_cast<streamsize>(remainingSize));
|
||||
#else
|
||||
#if defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
|
||||
decryptedStream.rdbuf()->pubsetbuf(decryptedData.data(), static_cast<streamsize>(remainingSize));
|
||||
#else
|
||||
decryptedStream.write(decryptedData.data(), static_cast<streamsize>(remainingSize));
|
||||
#endif
|
||||
if (m_version >= 0x5u) {
|
||||
BinaryReader reader(&decryptedStream);
|
||||
|
|
Loading…
Reference in New Issue