boostorg / iostreams

Boost.org iostreams module
http://boost.org/libs/iostreams
Boost Software License 1.0
43 stars 116 forks source link

Fix compilation for PS4 libraries #129

Open pkierski opened 3 years ago

pkierski commented 3 years ago

This is a simple compatibility fix for PS4 standard libraries. They don't have Dinkumware-like fpos_t implementation. The minimal code to reproduce problem/check solution:

#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/operations.hpp>

class SourceMock
{
public:
    using char_type = char;
    using category = boost::iostreams::source_tag;
    std::streamsize read(char* /*buffer*/, std::streamsize /*size*/) { return 0; }
};

void foo()
{
    SourceMock source;
    char buffer[42];
    boost::iostreams::read(source, buffer, sizeof(buffer));
}

Output without fix looks like:

1>In file included from foo.ccp:2:
1>In file included from C:\.conan\7fa4fb\1\include\boost/iostreams/operations.hpp:16:
1>In file included from C:\.conan\7fa4fb\1\include\boost/iostreams/close.hpp:19:
1>In file included from C:\.conan\7fa4fb\1\include\boost/iostreams/detail/adapter/non_blocking_adapter.hpp:13:
1>In file included from C:\.conan\7fa4fb\1\include\boost/iostreams/seek.hpp:23:
1>C:\.conan\7fa4fb\1\include\boost/iostreams/positioning.hpp(52,10): error : no matching constructor for initialization of 'std::streampos' (aka 'fpos<_Mbstatet>')
1>C:\Program Files (x86)\SCE\ORBIS SDKs\7.000\target\include\iosfwd(48,2): note: candidate constructor not viable: no known conversion from 'boost::iostreams::stream_offset' (aka 'long') to 'fpos_t' for 2nd argument
1>C:\Program Files (x86)\SCE\ORBIS SDKs\7.000\target\include\iosfwd(43,2): note: candidate constructor not viable: allows at most single argument '_Off', but 2 arguments were provided
1>C:\Program Files (x86)\SCE\ORBIS SDKs\7.000\target\include\iosfwd(38,8): note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
1>C:\Program Files (x86)\SCE\ORBIS SDKs\7.000\target\include\iosfwd(38,8): note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
codecov[bot] commented 3 years ago

Codecov Report

Merging #129 (e30b6e2) into develop (f4ea3c9) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #129   +/-   ##
========================================
  Coverage    68.84%   68.84%           
========================================
  Files           80       80           
  Lines         3444     3444           
  Branches      1027     1027           
========================================
  Hits          2371     2371           
  Misses         454      454           
  Partials       619      619           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4d2e763...e30b6e2. Read the comment docs.