summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2006-04-20 06:09:51 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2006-04-20 06:09:51 (GMT)
commit7e5de2473bb2bf780a69995665e2df091c8df9cf (patch)
tree58f680a4af603a981b59c3334689a13f8f792faa /src
parent57a2e33c57a54939fb5e2feadb077fa5ba8f3de1 (diff)
downloadhdf5-7e5de2473bb2bf780a69995665e2df091c8df9cf.zip
hdf5-7e5de2473bb2bf780a69995665e2df091c8df9cf.tar.gz
hdf5-7e5de2473bb2bf780a69995665e2df091c8df9cf.tar.bz2
[svn-r12286] Purpose: Fix bug
Description: The file size test in C++ library failed on Copper because the value returned by h5_get_file_size was intepreted incorrectly due to different interger sizes. Solution: H5private.h: Added check to use stat64 and off64_t where appropriate. h5test.c and h5test.h: used h5_stat_size_t in place of off_t. tattr.cpp: used h5_stat_size_t in place of off_t. Platforms tested: Linux 2.4 (heping) AIX 5.1 (copper) SunOS 5.8 64-bit (sol) - still on going
Diffstat (limited to 'src')
-rw-r--r--src/H5private.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 263b529..98793a8 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -668,9 +668,15 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
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;
+ #if H5_SIZEOF___INT64==8
+ #define HDfstat(F,B) fstat64(F,B)
+ typedef struct stat64 h5_stat_t;
+ typedef off64_t h5_stat_size_t;
+ #else
+ #define HDfstat(F,B) fstat(F,B)
+ typedef struct stat h5_stat_t;
+ typedef off_t h5_stat_size_t;
+ #endif
#endif
#define HDftell(F) ftell(F)
@@ -850,8 +856,12 @@ H5_DLL void HDsrand(unsigned int seed);
#define HDstat(S,B) _stati64(S,B)
#endif
#else
+ #if H5_SIZEOF___INT64==8
+ #define HDstat(S,B) stat64(S,B)
+ #else
#define HDstat(S,B) stat(S,B)
#endif
+#endif
#define HDstrcat(X,Y) strcat(X,Y)
#define HDstrchr(S,C) strchr(S,C)