Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-19 12:04:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-19 12:18:03 +0300
commit7ba82f3f0a848aedcc0f3b3f73a429f740792dbe (patch)
tree649e40dfd58a195f30e08828339c0bdc06e8c5a8 /source/blender/blenloader/intern/readfile.h
parent4db7842a72cc2f9cdca31c08d45c703ad8519dc0 (diff)
Fix T62707: opening blend files over 2gb on win32 fails
Regression in 358e07f447e9ed7 for ms-windows since off_t is an int32_t even on 64bit systems causing files over 2gb not to load. Poison off_t so this doesn't happen again.
Diffstat (limited to 'source/blender/blenloader/intern/readfile.h')
-rw-r--r--source/blender/blenloader/intern/readfile.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index 9e970b9ae5d..a1af4bfad16 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -48,10 +48,17 @@ enum eFileDataFlag {
FD_FLAGS_NOT_MY_LIBMAP = 1 << 5,
};
+/* Disallow since it's 32bit on ms-windows. */
+#ifdef __GNUC__
+# pragma GCC poison off_t
+#endif
+#if defined(_MSC_VER)
+typedef int64_t off64_t;
+#endif
typedef int (FileDataReadFn)(struct FileData *filedata, void *buffer, unsigned int size);
-typedef off_t (FileDataSeekFn)(struct FileData *filedata, off_t offset, int whence);
+typedef off64_t (FileDataSeekFn)(struct FileData *filedata, off64_t offset, int whence);
typedef struct FileData {
/** Linked list of BHeadN's. */
@@ -59,7 +66,7 @@ typedef struct FileData {
enum eFileDataFlag flags;
bool is_eof;
int buffersize;
- off_t file_offset;
+ int64_t file_offset;
FileDataReadFn *read;
FileDataSeekFn *seek;