// Converts a std::fpos_t to a stream_offset inline stream_offset fpos_t_to_offset(std::fpos_t pos) { # if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64) || defined(__IBMCPP__) return pos; # else return _FPOSOFF(pos); # endif }
inline stream_offset position_to_offset(std::streampos pos) { return fpos_t_to_offset(streampos_to_fpos_t(pos)) + static_cast<stream_offset>( static_cast<std::streamoff>(pos) - _FPOSOFF(streampos_to_fpos_t(pos)) ); }
inline stream_offset fpos_t_to_offset(std::fpos_t pos) { // Helper function. #if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64) return pos; #else return _FPOSOFF(pos); #endif }
int CStdLibFileIO::GetPosition() { fpos_t fPosition; memset(&fPosition, 0, sizeof(fPosition)); fgetpos(m_pFile, &fPosition); return _FPOSOFF(fPosition); }