Skip to content

Commit f787f15

Browse files
tsdgeosTheAssassin
authored andcommitted
Fix build with libc++
Two fixes: * std::istream does not have a default constructor in the C++ standard, so do what the libstdc++ constructor does * _M_in_beg and friends are not part of the C++ standard, use the actual functions that return those values in libstdc++
1 parent 4c7317c commit f787f15

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/libappimage/core/impl/PayloadIStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace appimage {
1717
friend class TraversalType1;
1818
friend class TraversalType2;
1919

20-
PayloadIStream() = default;
20+
PayloadIStream() : std::istream(nullptr) {}
2121

2222
// Creating copies of this object is not allowed
2323
PayloadIStream(PayloadIStream& other) = delete;

src/libappimage/core/impl/StreambufType1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ StreambufType1::StreambufType1(archive* a, unsigned long size) : a(a), size(size
2727
StreambufType1::StreambufType1(StreambufType1&& other) noexcept
2828
: a(other.a), size(other.size), buffer(std::move(other.buffer)) {
2929
// Reset the three read area pointers
30-
setg(other._M_in_beg, other._M_in_cur, other._M_in_end);
30+
setg(other.eback(), other.gptr(), other.egptr());
3131
}
3232

3333
StreambufType1& StreambufType1::operator=(StreambufType1&& other) noexcept {
@@ -36,7 +36,7 @@ StreambufType1& StreambufType1::operator=(StreambufType1&& other) noexcept {
3636
buffer = std::move(other.buffer);
3737

3838
// Reset the three read area pointers
39-
setg(other._M_in_beg, other._M_in_cur, other._M_in_end);
39+
setg(other.eback(), other.gptr(), other.egptr());
4040

4141
return *this;
4242
}

src/libappimage/core/impl/StreambufType2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ StreambufType2::StreambufType2(StreambufType2&& other) noexcept
2626
: fs(other.fs), inode(other.inode), buffer(std::move(other.buffer)) {
2727

2828
// Reset the three read area pointers
29-
setg(other._M_in_beg, other._M_in_cur, other._M_in_end);
29+
setg(other.eback(), other.gptr(), other.egptr());
3030
}
3131

3232
StreambufType2& StreambufType2::operator=(StreambufType2&& other) noexcept {
@@ -35,7 +35,7 @@ StreambufType2& StreambufType2::operator=(StreambufType2&& other) noexcept {
3535
buffer = std::move(other.buffer);
3636

3737
// Reset the three read area pointers
38-
setg(other._M_in_beg, other._M_in_cur, other._M_in_end);
38+
setg(other.eback(), other.gptr(), other.egptr());
3939
return *this;
4040
}
4141

0 commit comments

Comments
 (0)