Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3924 Modified Files: Tag: release21-maint fileobject.c Log Message: MvL's patch to fix up large file support. You still need to enable it manually with, e.g.: CC='gcc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' ./configure Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.110 retrieving revision 2.110.2.1 diff -C2 -d -r2.110 -r2.110.2.1 *** fileobject.c 2001/04/14 17:49:40 2.110 --- fileobject.c 2002/01/07 06:42:37 2.110.2.1 *************** *** 226,230 **** _portable_fseek(FILE *fp, Py_off_t offset, int whence) { ! #if defined(HAVE_FSEEKO) return fseeko(fp, offset, whence); #elif defined(HAVE_FSEEK64) --- 226,232 ---- _portable_fseek(FILE *fp, Py_off_t offset, int whence) { ! #if !defined(HAVE_LARGEFILE_SUPPORT) ! return fseek(fp, offset, whence); ! #elif defined(HAVE_FSEEKO) && SIZEOF_OFF_T >= 8 return fseeko(fp, offset, whence); #elif defined(HAVE_FSEEK64) *************** *** 232,236 **** #elif defined(__BEOS__) return _fseek(fp, offset, whence); ! #elif defined(HAVE_LARGEFILE_SUPPORT) && SIZEOF_FPOS_T >= 8 /* lacking a 64-bit capable fseek(), use a 64-bit capable fsetpos() and fgetpos() to implement fseek()*/ --- 234,238 ---- #elif defined(__BEOS__) return _fseek(fp, offset, whence); ! #elif SIZEOF_FPOS_T >= 8 /* lacking a 64-bit capable fseek(), use a 64-bit capable fsetpos() and fgetpos() to implement fseek()*/ *************** *** 238,243 **** --- 240,251 ---- switch (whence) { case SEEK_END: + #ifdef MS_WINDOWS + fflush(fp); + if (_lseeki64(fileno(fp), 0, 2) == -1) + return -1; + #else if (fseek(fp, 0, SEEK_END) != 0) return -1; + #endif /* fall through */ case SEEK_CUR: *************** *** 250,254 **** return fsetpos(fp, &offset); #else ! return fseek(fp, offset, whence); #endif } --- 258,262 ---- return fsetpos(fp, &offset); #else ! #error "Large file support, but no way to fseek." #endif } *************** *** 261,275 **** _portable_ftell(FILE* fp) { ! #if SIZEOF_FPOS_T >= 8 && defined(HAVE_LARGEFILE_SUPPORT) fpos_t pos; if (fgetpos(fp, &pos) != 0) return -1; return pos; - #elif defined(HAVE_FTELLO) && defined(HAVE_LARGEFILE_SUPPORT) - return ftello(fp); - #elif defined(HAVE_FTELL64) && defined(HAVE_LARGEFILE_SUPPORT) - return ftell64(fp); #else ! return ftell(fp); #endif } --- 269,285 ---- _portable_ftell(FILE* fp) { ! #if !defined(HAVE_LARGEFILE_SUPPORT) ! return ftell(fp); ! #elif defined(HAVE_FTELLO) && SIZEOF_OFF_T >= 8 ! return ftello(fp); ! #elif defined(HAVE_FTELL64) ! return ftell64(fp); ! #elif SIZEOF_FPOS_T >= 8 fpos_t pos; if (fgetpos(fp, &pos) != 0) return -1; return pos; #else ! #error "Large file support, but no way to ftell." #endif }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4