summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2006-05-14 05:09:25 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2006-05-14 05:09:25 (GMT)
commit84b03a51c7104f2b691c7067d0d82b28880b9086 (patch)
tree3a68086ed4a0d90232708c2214f5c1fa55fe775d /src/H5private.h
parent0742585e9aaacf513a5ab44da5e4755c9c0c5d60 (diff)
downloadhdf5-84b03a51c7104f2b691c7067d0d82b28880b9086.zip
hdf5-84b03a51c7104f2b691c7067d0d82b28880b9086.tar.gz
hdf5-84b03a51c7104f2b691c7067d0d82b28880b9086.tar.bz2
[svn-r12348] Purpose:
Bug fix. Description: Some machines (e.g., HPUX) will have off64_t defined but no support for stat64 unless certain LargeFile macro is turned on. This caused the last fix on H5private not quite right which caused compiling failures. Solution: Added stat64 and fstat64 tests and then will use them only if they are supported. Platforms tested: Tested on kelgia, copper and heping (pll). (Compiling alright but tests for kelgia and heping are not done. expect no problems.)
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/H5private.h b/src/H5private.h
index f400f88..5ae7baf 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -664,19 +664,23 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#ifdef WIN32
#ifdef __MWERKS__
#define HDfstat(F,B) fstat(F,B)
+ #define HDstat(S,B) stat(S,B)
typedef struct stat h5_stat_t;
typedef off_t h5_stat_size_t;
#else /*MSVC*/
#define HDfstat(F,B) _fstati64(F,B)
+ #define HDstat(S,B) _stati64(S,B)
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
#endif
-#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8
+#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64)
#define HDfstat(F,B) fstat64(F,B)
+ #define HDstat(S,B) stat64(S,B)
typedef struct stat64 h5_stat_t;
typedef off64_t h5_stat_size_t;
#else
#define HDfstat(F,B) fstat(F,B)
+ #define HDstat(S,B) stat(S,B)
typedef struct stat h5_stat_t;
typedef off_t h5_stat_size_t;
#endif
@@ -851,18 +855,6 @@ H5_DLL void HDsrand(unsigned int seed);
#endif
/* sscanf() variable arguments */
-#ifdef WIN32
- #ifdef __MWERKS__
- #define HDstat(S,B) stat(S,B)
- #else /*MSVC*/
- #define HDstat(S,B) _stati64(S,B)
- #endif
-#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8
- #define HDstat(S,B) stat64(S,B)
-#else
- #define HDstat(S,B) stat(S,B)
-#endif
-
#define HDstrcat(X,Y) strcat(X,Y)
#define HDstrchr(S,C) strchr(S,C)
#define HDstrcmp(X,Y) strcmp(X,Y)