diff options
Diffstat (limited to 'src/H5FDsec2.c')
-rw-r--r-- | src/H5FDsec2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index ceacaab..5b73475 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -114,7 +114,7 @@ typedef struct H5FD_sec2_t { # /*MSVC*/ # define file_offset_t __int64 # define file_seek _lseeki64 -# define file_truncate _ftruncatei64 +# define file_truncate _chsize #else # define file_offset_t off_t # define file_seek lseek @@ -141,7 +141,6 @@ typedef struct H5FD_sec2_t { ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - sizeof(file_offset_t)<sizeof(size_t) || \ HADDR_UNDEF==(A)+(Z) || \ (file_offset_t)((A)+(Z))<(file_offset_t)(A)) @@ -306,6 +305,9 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t UNUSED fapl_id, FUNC_ENTER_NOAPI(H5FD_sec2_open, NULL) + /* Sanity check on file offsets */ + assert(sizeof(file_offset_t)>=sizeof(size_t)); + /* Check arguments */ if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") |