Revision: 9005 https://osdn.net/projects/ttssh2/scm/svn/commits/9005 Author: zmatsuo Date: 2020-11-02 00:37:32 +0900 (Mon, 02 Nov 2020) Log Message: ----------- size_t が 64/32bit 異なっているのを考慮 Modified Paths: -------------- branches/proto_unicode/teraterm/ttpfile/filesys_win32.cpp -------------- next part -------------- Modified: branches/proto_unicode/teraterm/ttpfile/filesys_win32.cpp =================================================================== --- branches/proto_unicode/teraterm/ttpfile/filesys_win32.cpp 2020-11-01 15:37:20 UTC (rev 9004) +++ branches/proto_unicode/teraterm/ttpfile/filesys_win32.cpp 2020-11-01 15:37:32 UTC (rev 9005) @@ -103,11 +103,20 @@ /** * @retval 0 ok * @retval -1 error + * TODO size_t \x88ȏ\xE3\x82̃t\x83@\x83C\x83\x8B\x82̈\xB5\x82\xA2 + * */ static int Seek(struct FileVarProto *fv, size_t offset) { +#if _M_X64 + // sizeof(size_t) == 8 LONG lo = (LONG)((offset >> 0) & 0xffffffff); LONG hi = (LONG)((offset >> 32) & 0xffffffff); +#else + // sizeof(size_t) == 4 + LONG lo = (LONG)((offset >> 0) & 0xffffffff); + LONG hi = 0; +#endif SetFilePointer(fv->FileHandle, lo, &hi, 0); if (GetLastError() != 0) { return -1;