Commit 4a2c67fe authored by Junmin Gu's avatar Junmin Gu
Browse files

work around with include <unistd.h> on windows

parent b18fec62
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -9,6 +9,21 @@ 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)

message("- HAVE_UNISTD?  ${HAVE_UNISTD_H} ")
message("- HAVE_WINDOWS? ${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
+7 −0
Original line number Diff line number Diff line
@@ -16,7 +16,14 @@
#include "H5VolReadWrite.h"

#include "H5VolUtil.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h> // sleep
#elif defined HAVE_WINDOWS_H
#include <windows.h>
#define sleep(x) Sleep(1000 * (x))
#endif

// these are in h5private.h
#define SUCCEED 1
#define FAIL 0