[svn-r2750]

Purpose:
    Port to Windows.
Description:
    The stream_test program now also compiles and can be run under Windows.
Solution:
    The problem was that fork(2) and waitpid(2) aren't available
    under Windows when using the MS compilers.
    So I test for both H5_HAVE_FORK and H5_HAVE_WAITPID.
    These are already checked fortunately during configuration.

    If they are not there the code just says
      printf ("Test skipped because this architecture doesn't provide "
              "fork(2) and waitpid(2)\n");

Platforms tested:
    Windows NT, both with MS Visual C++ and GNU cc
    Now you can build and run the Stream VFD testsuite under Windows
    when using GNU cc !!
This commit is contained in:
Thomas Radke 2000-10-28 14:19:39 -05:00
parent 9c93282d1b
commit 4b78390eda

View File

@ -6,7 +6,11 @@
* Author: Thomas Radke <tradke@aei-potsdam.mpg.de>
* Tuesday, September 12, 2000
*
* Version: $Id$
*
* Modifications:
* Thomas Radke, Thursday, October 26, 2000
* Made it compiling under Windows.
*
*/
@ -28,23 +32,34 @@
* processes and returns their exit code.
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <h5test.h>
#include <hdf5.h>
#ifndef H5_HAVE_STREAM
int main (void)
{
printf ("Test skipped because Stream Virtual File Driver not available\n");
return (0);
printf ("Test skipped because Stream Virtual File Driver not available\n");
return (0);
}
#elif ! defined (H5_HAVE_FORK) || ! defined (H5_HAVE_WAITPID)
int main (void)
{
printf ("Test skipped because this architecture doesn't provide "
"fork(2) and waitpid(2)\n");
return (0);
}
#else
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#define DELAY 10 /* sleeping time in seconds */
#define RANK 2 /* sample dataset rank */
#define DIMS 50 /* sample dataset dimensions */