Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove checks for winsock2.h #813

Merged
merged 1 commit into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,6 @@
/* Define if your system has window style path name. */
#cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@

/* Define to 1 if you have the <winsock2.h> header file. */
#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@

/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@

Expand Down
6 changes: 0 additions & 6 deletions config/cmake_ext_mod/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ if (MINGW)
set (${HDF_PREFIX}_HAVE_MINGW 1)
set (WINDOWS 1) # MinGW tries to imitate Windows
set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
set (__USE_MINGW_ANSI_STDIO 1)
endif ()

Expand Down Expand Up @@ -117,11 +116,6 @@ CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)

# Windows
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
endif ()

CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
Expand Down
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1240,8 +1240,6 @@ case $host_os in
esac

## Windows
## The winsock header is needed for gethostname
AC_CHECK_HEADERS([winsock2.h])
case "`uname`" in
MINGW*)
AC_HAVE_LIBRARY([ws2_32])
Expand Down
13 changes: 6 additions & 7 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,21 @@
#define H5_DEFAULT_VOL H5VL_NATIVE

#ifdef H5_HAVE_WIN32_API

/* The following two defines must be before any windows headers are included */
#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
#define NOGDI /* Exclude Graphic Display Interface macros */

#ifdef H5_HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <windows.h>

#include <direct.h> /* For _getcwd() */
#include <io.h> /* POSIX I/O */
#include <winsock2.h> /* For GetUserName() */

#ifdef H5_HAVE_THREADSAFE
#include <process.h> /* For _beginthread() */
#endif

#include <windows.h>
#include <direct.h> /* For _getcwd() */
#include <io.h> /* POSIX I/O */

#endif /*H5_HAVE_WIN32_API*/

#ifndef F_OK
Expand Down
6 changes: 3 additions & 3 deletions src/H5system.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Wsetenv(const char *name, const char *value, int overwrite)
return (int)_putenv_s(name, value);
} /* end Wsetenv() */

#ifdef H5_HAVE_WINSOCK2_H
#ifdef H5_HAVE_WIN32_API
#pragma comment(lib, "advapi32.lib")
#endif

Expand Down Expand Up @@ -450,12 +450,12 @@ char *
Wgetlogin(void)
{

#ifdef H5_HAVE_WINSOCK2_H
#ifdef H5_HAVE_WIN32_API
DWORD bufferCount = WloginBuffer_count;
if (GetUserName(Wlogin_buffer, &bufferCount) != 0)
return (Wlogin_buffer);
else
#endif /* H5_HAVE_WINSOCK2_H */
#endif
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/lib/io_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sys/time.h>
#endif

#ifdef H5_HAVE_WINSOCK2_H
#ifdef H5_HAVE_WIN32_API
#include <winsock2.h>
#endif

Expand Down