fixed windows build issue in file, as well as expanded the comment at the static assert

This commit is contained in:
Arvid Norberg 2009-06-09 05:46:51 +00:00
parent 25fb419a44
commit 7eb78298f3
1 changed files with 6 additions and 1 deletions

View File

@ -54,7 +54,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
// make sure the _FILE_OFFSET_BITS define worked // make sure the _FILE_OFFSET_BITS define worked
// on this platform // on this platform. It's supposed to make file
// related functions support 64-bit offsets.
// this test makes sure lseed() returns a type
// at least 64 bits wide
BOOST_STATIC_ASSERT(sizeof(lseek(0, 0, 0)) >= 8); BOOST_STATIC_ASSERT(sizeof(lseek(0, 0, 0)) >= 8);
#endif #endif
@ -804,6 +807,7 @@ namespace libtorrent
ec = error_code(GetLastError(), get_system_category()); ec = error_code(GetLastError(), get_system_category());
return false; return false;
} }
#if _WIN32_WINNT >= 0x501
if ((m_open_mode & sparse) == 0) if ((m_open_mode & sparse) == 0)
{ {
// if the user has permissions, avoid filling // if the user has permissions, avoid filling
@ -811,6 +815,7 @@ namespace libtorrent
// garbage instead // garbage instead
SetFileValidData(m_file_handle, offs.QuadPart); SetFileValidData(m_file_handle, offs.QuadPart);
} }
#endif
if (::SetEndOfFile(m_file_handle) == FALSE) if (::SetEndOfFile(m_file_handle) == FALSE)
{ {
ec = error_code(GetLastError(), get_system_category()); ec = error_code(GetLastError(), get_system_category());