diff --git a/source/h5vol/CMakeLists.txt b/source/h5vol/CMakeLists.txt index c94593a70e..e8c2ce4461 100644 --- a/source/h5vol/CMakeLists.txt +++ b/source/h5vol/CMakeLists.txt @@ -9,6 +9,18 @@ if(CMAKE_C_COMPILER_ID MATCHES "^(GNU)$") string(APPEND CMAKE_C_FLAGS " -Wno-format-zero-length") endif() +include(CheckIncludeFiles) +check_include_files(unistd.h HAVE_UNISTD_H) +check_include_files(windows.h HAVE_WINDOWS_H) + +if (HAVE_UNISTD_H) + add_definitions(-DHAVE_UNISTD_H) +endif() + +if (HAVE_WINDOWS_H) + add_definitions(-DHAVE_WINDOWS_H) +endif() + add_library(adios2_h5vol H5VolReadWrite.c H5Vol.c diff --git a/source/h5vol/H5VolReadWrite.c b/source/h5vol/H5VolReadWrite.c index f049d9ad85..5633eaf03d 100644 --- a/source/h5vol/H5VolReadWrite.c +++ b/source/h5vol/H5VolReadWrite.c @@ -16,7 +16,14 @@ #include "H5VolReadWrite.h" #include "H5VolUtil.h" + +#ifdef HAVE_UNISTD_H #include // sleep +#elif defined HAVE_WINDOWS_H +#include +#define sleep(x) Sleep(1000 * (x)) +#endif + // these are in h5private.h #define SUCCEED 1 #define FAIL 0