summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/H5config.h.in6
-rw-r--r--src/H5private.h18
2 files changed, 11 insertions, 13 deletions
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 062ab9a..15bb630 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -93,6 +93,9 @@
/* Define to 1 if you have the `fseek64' function. */
#undef HAVE_FSEEK64
+/* Define to 1 if you have the `fstat64' function. */
+#undef HAVE_FSTAT64
+
/* Define if the compiler understand the __FUNCTION__ keyword */
#undef HAVE_FUNCTION
@@ -232,6 +235,9 @@
/* Define to 1 if you have the `srandom' function. */
#undef HAVE_SRANDOM
+/* Define to 1 if you have the `stat64' function. */
+#undef HAVE_STAT64
+
/* Define if `struct stat' has the `st_blocks' field */
#undef HAVE_STAT_ST_BLOCKS
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)