[svn-r781] Windows NT port-tested on Unix and NT

changes: defined __unused__ as nothing, other little changes.
	all changes are surrounded by #if defined(WIN32)
This commit is contained in:
Patrick Lu 1998-10-23 13:16:48 -05:00
parent 9bba487ca4
commit 3a7c54b06f
14 changed files with 131 additions and 7 deletions

View File

@ -21,8 +21,11 @@
#define WRT_N 50
#define WRT_SIZE 4*1024
#define FAMILY_SIZE 1024*1024*1024
#if defined(WIN32)
#define GB8LL ((unsigned __int64)8*1024*1024*1024)
#else
#define GB8LL ((unsigned long long)8*1024*1024*1024)
#endif
static hsize_t
randll (hsize_t limit)
{
@ -87,7 +90,11 @@ 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)
return (sb.st_blocks*512 < (unsigned)sb.st_size);
#else
return (0);
#endif
}

View File

@ -25,6 +25,11 @@
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#define FILE_NAME "chunk.h5"
#define LINESPOINTS "lines"
#define CH_SIZE 100 /*squared in terms of bytes */
@ -235,7 +240,12 @@ static double
test_diag (int op, hsize_t cache_size, hsize_t io_size, hsize_t offset)
{
hid_t file, dset, mem_space, file_space;
hsize_t i, hs_size[2], nio=0;
hsize_t i, hs_size[2];
#if defined(WIN32)
hssize_t nio = 0;
#else
hsize_t nio = 0;
#endif
hssize_t hs_offset[2];
char *buf = calloc (1, SQUARE (io_size));
int mdc_nelmts, rdcc_nelmts;

View File

@ -21,6 +21,11 @@
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#define TEST_FILE_NAME "cmpd_dset.h5"
/* The first dataset */

View File

@ -13,8 +13,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !defined(WIN32)
#include <unistd.h>
#endif
#include <H5config.h>
#ifndef HAVE_ATTRIBUTE
# undef __attribute__
@ -23,6 +24,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#ifndef HAVE_FUNCTION
# undef __FUNCTION__

View File

@ -15,8 +15,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#if !defined (WIN32)
#include <sys/wait.h>
#include <unistd.h>
#endif
#define H5T_PACKAGE
#include <H5Tpkg.h> /*to turn off hardware conversions*/
@ -29,6 +32,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#if SIZEOF_DOUBLE != SIZEOF_LONG_DOUBLE
# define USE_LDOUBLE

View File

@ -13,7 +13,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !defined(WIN32)
#include <unistd.h>
#endif
#include <H5config.h>
#ifndef HAVE_ATTRIBUTE
@ -24,6 +26,11 @@
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#define TEST_FILE_NAME1 "extern_1.h5"
#define TEST_FILE_NAME2 "extern_2.h5"
#define TEST_FILE_NAME3 "extern_3.h5"

View File

@ -10,8 +10,9 @@
#include <fcntl.h>
#include <hdf5.h>
#include <stdlib.h>
#if !defined(WIN32)
#include <unistd.h>
#endif
/*
* Define NO_FILLING if you want to compare how this test works when there is
* no fill value (that is, when the fill value is zero).
@ -35,7 +36,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
/*-------------------------------------------------------------------------
* Function: cleanup

View File

@ -13,9 +13,16 @@
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#if defined(WIN32)
#include <time.h>
#include <Winsock.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#endif
#define RAW_FILE_NAME "iopipe.raw"
#define HDF5_FILE_NAME "iopipe.h5"
@ -141,13 +148,21 @@ synchronize (void)
int
main (void)
{
#if defined(WIN32)
static hssize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y};
#else
static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y};
#endif
static int nread=NREAD_REQUESTS, nwrite=NWRITE_REQUESTS;
unsigned char *the_data = NULL;
hid_t file, dset, file_space=-1;
herr_t status;
#if !defined(WIN32)
struct rusage r_start, r_stop;
#else
struct timeval r_start, r_stop;
#endif
struct timeval t_start, t_stop;
int i, fd;
hssize_t n;
@ -179,7 +194,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "fill raw");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
@ -189,7 +206,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("fill raw",
&r_start, &r_stop, &t_start, &t_stop,
@ -201,7 +220,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "fill hdf5");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@ -213,7 +234,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("fill hdf5",
&r_start, &r_stop, &t_start, &t_stop,
@ -224,7 +247,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "out raw");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
@ -237,7 +262,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("out raw",
&r_start, &r_stop, &t_start, &t_stop,
@ -248,7 +275,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "out hdf5");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
@ -260,7 +289,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("out hdf5",
&r_start, &r_stop, &t_start, &t_stop,
@ -271,7 +302,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "in raw");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@ -284,7 +317,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("in raw",
&r_start, &r_stop, &t_start, &t_stop,
@ -296,7 +331,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "in hdf5");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@ -308,7 +345,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("in hdf5",
&r_start, &r_stop, &t_start, &t_stop,
@ -324,7 +363,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
#if !defined(WIN32)
gettimeofday (&t_start, NULL);
#endif
fprintf (stderr, HEADING, "in hdf5 partial");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@ -336,7 +377,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
#endif
putc ('\n', stderr);
print_stats ("in hdf5 partial",
&r_start, &r_stop, &t_start, &t_stop,

View File

@ -20,6 +20,10 @@
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#define TEST_FILE_NAME "links.h5"
#define FALSE 0

View File

@ -26,6 +26,10 @@
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
/*-------------------------------------------------------------------------
* Function: cleanup

View File

@ -13,7 +13,9 @@
#include <assert.h>
#include <hdf5.h>
#include <math.h>
#if !defined(WIN32)
#include <sys/time.h>
#endif
#include <time.h>
#define FALSE 0
@ -28,7 +30,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
/*-------------------------------------------------------------------------
* Function: display_error_cb

View File

@ -196,7 +196,11 @@ ragged_write_all(hid_t ra, hsize_t rows_at_once)
hssize_t row; /*current row number */
hsize_t i; /*counter */
hsize_t max_width = quant_g[NELMTS(quant_g)-1].hi;
#if !defined(WIN32)
hsize_t interval_nelmts; /*elmts/interval timer */
#else
hssize_t interval_nelmts; /*elmts/interval timer */
#endif
hsize_t *size=NULL; /*size of each row */
void **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */
@ -298,7 +302,11 @@ ragged_read_all(hid_t ra, hsize_t rows_at_once)
int total_nelmts=0;
hsize_t i, j; /*counters */
hssize_t row; /*current row number */
#if !defined(WIN32)
hsize_t interval_nelmts; /*elmts/interval timer */
#else
hssize_t interval_nelmts; /*elmts/interval timer */
#endif
hsize_t *size=NULL; /*size of each row */
C_MTYPE **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */
@ -429,8 +437,14 @@ ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width)
int total_nelmts=0;
hsize_t i, j;
hssize_t row; /*current row number */
#if !defined(WIN32)
hsize_t interval_nelmts; /*elmts/interval timer */
hsize_t read_nelmts=0; /*total elements read */
hsize_t read_nelmts=0; /*total elements read */
#else
hssize_t read_nelmts=0; /*total elements read */
hssize_t interval_nelmts; /*elmts/interval timer */
#endif
hsize_t *size=NULL; /*size of each row */
C_MTYPE **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */

View File

@ -20,6 +20,11 @@
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#define TEST_FILE_NAME0 "shtype0.h5"
#define TEST_FILE_NAME1 "shtype1.h5"
#define TEST_FILE_NAME2A "shtype2a.h5"

View File

@ -18,6 +18,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
#if defined(WIN32)
#undef __unused__
#define __unused__
#endif
#define FILE_NAME_1 "unlink.h5"
#define THE_OBJECT "/foo"