diff options
author | Ray Molenkamp <github@lazydodo.com> | 2020-03-18 21:13:03 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2020-03-18 21:13:03 +0300 |
commit | 9a116c7c2d957e0e10a926eccc38dcb28cfec6e4 (patch) | |
tree | 620a9efd22d96e6fce9ec8cf8f1c6c0c2996b687 /source/blender/blenloader | |
parent | ac74a843d2775c834454ede9e3161e574f5b2e7c (diff) |
Cleanup: 64 bit file IO on windows.
Unlike Linux where fseek/tell will be either 32 or 64 bit
depending on the target platform, it will always be 32 bit
on windows.
We had some macro magic in BLI_winstuff.h that substituted
them for 64 bit versions, but that is upsetting the system
headers if they get included after BLI_winstuff.h which
is problematic for D6811.
This diff adds proper functions in blenlib and updates
all calls that were using the BLI_winstuff.h header to
gain 64 bit file IO.
note: Anything that was using the 32 bit versions (ie not
including BLI_winstuff.h) will still be using the 32 bit
versions, which is perhaps a good code quality Friday project.
Differential Revision: https://developer.blender.org/D7160
Reviewers: brecht dfelinto
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 941783d1bec..f7c995d598e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1171,7 +1171,7 @@ static int fd_read_data_from_file(FileData *filedata, static off64_t fd_seek_data_from_file(FileData *filedata, off64_t offset, int whence) { - filedata->file_offset = lseek(filedata->filedes, offset, whence); + filedata->file_offset = BLI_lseek(filedata->filedes, offset, whence); return filedata->file_offset; } @@ -1349,7 +1349,7 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath, return NULL; } else { - lseek(file, 0, SEEK_SET); + BLI_lseek(file, 0, SEEK_SET); } /* Regular file. */ |