summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-12-10 21:22:43 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-12-10 21:22:43 (GMT)
commit5b043e6153dbc9085a2b1e95c77c4efae3bda272 (patch)
treeab451b0b1418a70aaa55ca6a3aa30a912229b9ff /src/H5private.h
parent48cc143edffdea0045e4deb60e8c9acd2fc5953f (diff)
downloadhdf5-5b043e6153dbc9085a2b1e95c77c4efae3bda272.zip
hdf5-5b043e6153dbc9085a2b1e95c77c4efae3bda272.tar.gz
hdf5-5b043e6153dbc9085a2b1e95c77c4efae3bda272.tar.bz2
[svn-r9651] Purpose: Bug fix
Description: In file H5FDsec2.c and H5FDlog.c, there's statements like H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,off_t,haddr_t); It assumes sb.st_size from h5_stat_t is of type off_t. But on Windows, it has type __int64. So the H5_ASSIGN_OVERFLOW statement may cause problem. Instead of trying to do switch between Windows and other systems in H5FDsec2.c and H5FDlog.c, define a substituting type in H5private.h to fix the problem. On Windows, this type is __int64; on other systems, it is off_t. Platforms tested: h5committest
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h
index d20be17..3a75fb1 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -618,15 +618,18 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
/* definitions related to the file stat utilities */
#ifdef WIN32
#ifdef __MWERKS__
- #define HDfstat(F,B) fstat(F,B)
+ #define HDfstat(F,B) fstat(F,B)
typedef struct stat h5_stat_t;
+ typedef off_t h5_stat_size_t;
#else /*MSVC*/
#define HDfstat(F,B) _fstati64(F,B)
typedef struct _stati64 h5_stat_t;
+ typedef __int64 h5_stat_size_t;
#endif
#else
#define HDfstat(F,B) fstat(F,B)
typedef struct stat h5_stat_t;
+typedef off_t h5_stat_size_t;
#endif
#define HDftell(F) ftell(F)