summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fxcrt/fx_safe_types.h1
-rw-r--r--core/fxcrt/fx_stream.h4
-rw-r--r--core/fxcrt/fx_system.h10
3 files changed, 11 insertions, 4 deletions
diff --git a/core/fxcrt/fx_safe_types.h b/core/fxcrt/fx_safe_types.h
index 66dbc57681..c7362b82f3 100644
--- a/core/fxcrt/fx_safe_types.h
+++ b/core/fxcrt/fx_safe_types.h
@@ -7,7 +7,6 @@
#include <stdlib.h> // For size_t.
-#include "core/fxcrt/fx_stream.h" // for FX_FILESIZE.
#include "core/fxcrt/fx_system.h"
#include "third_party/base/numerics/safe_math.h"
diff --git a/core/fxcrt/fx_stream.h b/core/fxcrt/fx_stream.h
index 4a89a3400e..51a602dfb5 100644
--- a/core/fxcrt/fx_stream.h
+++ b/core/fxcrt/fx_stream.h
@@ -16,9 +16,8 @@
class CFindFileDataA;
typedef CFindFileDataA FX_FileHandle;
-#define FX_FILESIZE int32_t
-#else
+#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#include <dirent.h>
#include <fcntl.h>
@@ -35,7 +34,6 @@ typedef CFindFileDataA FX_FileHandle;
#endif // O_LARGEFILE
typedef DIR FX_FileHandle;
-#define FX_FILESIZE off_t
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
FX_FileHandle* FX_OpenFolder(const char* path);
diff --git a/core/fxcrt/fx_system.h b/core/fxcrt/fx_system.h
index a99a18a332..89042daf71 100644
--- a/core/fxcrt/fx_system.h
+++ b/core/fxcrt/fx_system.h
@@ -77,6 +77,16 @@ extern "C" {
// TODO(palmer): it should be a |size_t|, or at least unsigned.
typedef int FX_STRSIZE;
+// PDFium file sizes match the platform, but PDFium itself does not support
+// files larger than 2GB even if the platform does. The value must be signed
+// to support -1 error returns.
+// TODO(tsepez): support larger files.
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define FX_FILESIZE int32_t
+#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define FX_FILESIZE off_t
+#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+
#ifndef ASSERT
#ifndef NDEBUG
#define ASSERT assert