summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-08-28 15:14:09 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-08-28 15:14:09 (GMT)
commit772813a13c8c358bf12a8f9105ed7d0466c65cc7 (patch)
tree0e4b70b6dd84faf212f38b46f6d3ea5c845df670
parent6b9c40e5c84624394449627b8108aa5db8ee4cd0 (diff)
downloadhdf5-772813a13c8c358bf12a8f9105ed7d0466c65cc7.zip
hdf5-772813a13c8c358bf12a8f9105ed7d0466c65cc7.tar.gz
hdf5-772813a13c8c358bf12a8f9105ed7d0466c65cc7.tar.bz2
fix get gethostname for windows
-rw-r--r--test/h5test.c2
-rw-r--r--testpar/CMakeLists.txt2
2 files changed, 3 insertions, 1 deletions
diff --git a/test/h5test.c b/test/h5test.c
index a6ec34d..c2e78e4 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1065,7 +1065,7 @@ h5_show_hostname(void)
#endif
#ifdef H5_HAVE_GETHOSTNAME
- if (gethostname(hostname, (size_t)80) < 0)
+ if (HDgethostname(hostname, (size_t)80) < 0)
HDprintf(" gethostname failed\n");
else
HDprintf(" hostname=%s\n", hostname);
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index 234a621..d652b01 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -45,11 +45,13 @@ MACRO (ADD_H5P_EXE file)
TARGET_C_PROPERTIES (${file} STATIC)
target_link_libraries (${file}
PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
)
else ()
TARGET_C_PROPERTIES (${file} SHARED)
target_link_libraries (${file}
PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
)
endif ()
set_target_properties (${file} PROPERTIES FOLDER test/par)