Open FrankXie05 opened 6 months ago
I'm not the author of this particular workaround for prior issues with Win32:
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) \
&& !defined(__QNX__)
...
And just use the path used by all platforms:
// do the old school streampos <-> streamoff casts inline std::streampos STREAM_POS( const OSGA_Archive::pos_type pos ) { return std::streampos( pos ); }
inline OSGA_Archive::pos_type ARCHIVE_POS( const std::streampos & pos ) { return OSGA_Archive::pos_type( pos ); }
I am the maintainer of vcpkg and we found above error when we test this port in an internal version of Visual Studio.
This error due to
_FPOSOFF'
has been completely deprecated after the standard MSVC-PR-132953 .For fixing this issue: we think bellow code https://github.com/openscenegraph/OpenSceneGraph/blob/2e4ae2ea94595995c1fc56860051410b0c0be605/src/osgPlugins/osga/OSGA_Archive.cpp#L80
could be change to
Reason: When
pos.operator std::streamoff()
is called, thestd::streampos
objectpos
is actually converted to thestd::streamoff
type to obtain itsoffset
in the stream. And_FPOSOFF(position)
is to get theoffset
of thefpos_t
object position in the stream.In this code, the calculate the
offset
ofpos
relative to position, but because the definition of_FPOSOFF
is no longer available, and since the result of_FPOSOFF(position)
is the same aspos.operator std::streamoff()
. Related PR: https://github.com/microsoft/STL/pull/4606 https://github.com/microsoft/vcpkg/pull/38666If you have other solotions, please ping me. I will apply it to vcpkg for this issue. :)