Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'_FPOSOFF' has been deprecated, error C3861: '_FPOSOFF': identifier not found #1323

Open
FrankXie05 opened this issue May 10, 2024 · 1 comment

Comments

@FrankXie05
Copy link

FrankXie05 commented May 10, 2024

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

std::streamoff offset = pos.operator std::streamoff( ) - _FPOSOFF( position );

could be change to

std::streamoff offset = 0;

Reason:
When pos.operator std::streamoff() is called, the std::streampos object pos is actually converted to the std::streamoff type to obtain its offset in the stream. And _FPOSOFF(position) is to get the offset of the fpos_t object position in the stream.

In this code, the calculate the offset of pos relative to position, but because the definition of _FPOSOFF is no longer available, and since the result of _FPOSOFF(position) is the same as pos.operator std::streamoff().
Related PR:
microsoft/STL#4606
microsoft/vcpkg#38666

If you have other solotions, please ping me. I will apply it to vcpkg for this issue. :)

@robertosfield
Copy link
Collaborator

I'm not the author of this particular workaround for prior issues with Win32:

#if ((defined(_YVALS) && !defined(IBMCPP)) || defined(_CPPLIB_VER)) &&
!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
&& !defined(QNX)

...

#else

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 );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants