--- common/libBuffer/include/CommonFWriteBufferFlusher.h 2011-08-31 03:10:37.609000056 -0600 +++ common/libBuffer/include/CommonFWriteBufferFlusher.h 2011-09-07 08:54:46.067000043 -0600 @@ -11,7 +11,9 @@ #ifndef __COMMON_FWRITEBUFFERFLUSHER_H__ #define __COMMON_FWRITEBUFFERFLUSHER_H__ +#define _FILE_OFFSET_BITS 64 #include "CommonIBufferFlusher.h" +#include #if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) || (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) # include @@ -25,7 +27,7 @@ class FWriteBufferFlusher : public IBufferFlusher { private: - typedef __int64 FilePosType; + typedef long long FilePosType; typedef std::tr1::unordered_map MarkIdToFilePos; public: static const size_t DEFAUL_BUFFER_SIZE = 64*1024; @@ -48,7 +50,7 @@ public: FWriteBufferFlusher( const char* fileName, size_t bufferSize = DEFAUL_BUFFER_SIZE, const char* mode="wb" ); - FWriteBufferFlusher( const wchar_t* fileName, size_t bufferSize = DEFAUL_BUFFER_SIZE, const wchar_t* mode=L"wb" ); +// FWriteBufferFlusher( const wchar_t* fileName, size_t bufferSize = DEFAUL_BUFFER_SIZE, const wchar_t* mode=L"wb" ); virtual ~FWriteBufferFlusher(); /** The error code of fopen_s.*/ --- common/libBuffer/src/CommonFWriteBufferFlusher.cpp 2011-08-31 03:10:37.658000055 -0600 +++ common/libBuffer/src/CommonFWriteBufferFlusher.cpp 2011-09-07 08:55:52.747000080 -0600 @@ -9,7 +9,8 @@ */ #include "CommonFWriteBufferFlusher.h" - +#include +#include namespace Common { @@ -32,7 +33,7 @@ } } //----------------------------------------------------------------------- - FWriteBufferFlusher::FWriteBufferFlusher( const wchar_t* fileName, size_t bufferSize, const wchar_t* mode/*=L"wb"*/ ) +/* FWriteBufferFlusher::FWriteBufferFlusher( const wchar_t* fileName, size_t bufferSize, const wchar_t* mode/*=L"wb"*//* ) : mBufferSize(bufferSize) , mBuffer( new char[bufferSize] ) #ifdef _WIN32 @@ -48,7 +49,7 @@ { mError = ( setvbuf( mStream , mBuffer, _IOFBF, mBufferSize ) != 0 ); } - } + }*/ //-------------------------------------------------------------------- FWriteBufferFlusher::~FWriteBufferFlusher() { @@ -83,7 +84,7 @@ void FWriteBufferFlusher::startMark() { // store the current file position - __int64 currentPos = _ftelli64( mStream); + long long currentPos = ftello( mStream); mLastMarkId++; mMarkIds.insert(std::make_pair(mLastMarkId, currentPos)); @@ -100,7 +101,7 @@ { if ( markId == END_OF_STREAM ) { - return (_fseeki64(mStream, 0, SEEK_END) == 0); + return (fseeko(mStream, 0, SEEK_END) == 0); } else { @@ -112,7 +113,7 @@ else { FilePosType pos = markIdIt->second; - bool success = (_fseeki64(mStream, pos, SEEK_SET) == 0); + bool success = (fseeko(mStream, pos, SEEK_SET) == 0); if ( !keepMarkId ) { mMarkIds.erase(markIdIt); --- common/libBuffer/include/CommonIBufferFlusher.h 2011-08-31 09:19:48.355000063 -0600 +++ common/libBuffer/include/CommonIBufferFlusher.h 2011-08-31 09:22:10.092000042 -0600 @@ -11,6 +11,8 @@ #ifndef __COMMON_IBUFFERFLUSHER_H__ #define __COMMON_IBUFFERFLUSHER_H__ +#include + namespace Common { /** Derived classes of this interface are used by Buffer.*/