summaryrefslogtreecommitdiffstats
path: root/test/big.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/big.c')
-rw-r--r--test/big.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/test/big.c b/test/big.c
index 108c1de..fc51e6e 100644
--- a/test/big.c
+++ b/test/big.c
@@ -5,15 +5,22 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Wednesday, April 8, 1998
*/
-#include <assert.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <hdf5.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
+/* See H5private.h for how to include headers */
+#undef NDEBUG
+#include <H5config.h>
+
+#ifdef STDC_HEADERS
+# include <assert.h>
+# include <ctype.h>
+# include <fcntl.h>
+# include <math.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <sys/stat.h>
+#endif
+
+#include <hdf5.h>
#include <H5private.h> /*needed for HDfprintf() */
#define FNAME "big%05d.h5"
@@ -21,11 +28,15 @@
#define WRT_N 50
#define WRT_SIZE 4*1024
#define FAMILY_SIZE 1024*1024*1024
-#if defined(WIN32)
+
+#if SIZEOF_LONG_LONG > SIZEOF_LONG
+#define GB8LL ((unsigned long long)8*1024*1024*1024)
+#elif SIZEOF___INT64 > SIZEOF_LONG
#define GB8LL ((unsigned __int64)8*1024*1024*1024)
#else
-#define GB8LL ((unsigned long long)8*1024*1024*1024)
+#define GB8LL ((long)1)
#endif
+
static hsize_t
randll (hsize_t limit)
{
@@ -90,10 +101,10 @@ is_sparse(void)
if (5!=write(fd, "hello", 5)) return 0;
if (stat("x.h5", &sb)<0) return 0;
if (unlink("x.h5")<0) return 0;
-#if !defined(WIN32)
+#ifdef HAVE_STAT_ST_BLOCKS
return (sb.st_blocks*512 < (unsigned)sb.st_size);
#else
- return (0);
+ return (0);
#endif
}