mirror of
https://github.com/libssh2/libssh2.git
synced 2026-10-24 03:48:58 +03:00
build: assume POSIX gettimeofday() in fallback codepath, stop detecting it
The codebase no longer relies on `gettimeofday()`. It still serves as an unconditional fallback in `ssh2_now()` on non-Windows, if no modern alternative exists. Let us know if this causes an issue. To simplify, make configure fast, and avoid the detection discrepancy between autotools and cmake. Follow-up to0d998d16c0#2494 Follow-up to694d38e33e#2493 Follow-up toa43dc6d504#2490 Follow-up to04665fedff#2491 Follow-up toc97959e9b6#2489 Follow-up to9c421761bc#2341 Closes #2485
This commit is contained in:
@@ -314,9 +314,7 @@ if(WIN32)
|
||||
if(MINGW)
|
||||
set(HAVE_UNISTD_H 1)
|
||||
set(HAVE_INTTYPES_H 1)
|
||||
set(HAVE_GETTIMEOFDAY 1)
|
||||
elseif(MSVC)
|
||||
set(HAVE_GETTIMEOFDAY 0)
|
||||
set(HAVE_UNISTD_H 0)
|
||||
if(MSVC_VERSION GREATER_EQUAL 1800)
|
||||
set(HAVE_INTTYPES_H 1)
|
||||
@@ -347,9 +345,6 @@ if(MSVC AND ENABLE_WERROR)
|
||||
string(APPEND CMAKE_REQUIRED_FLAGS " -WX-")
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 OR MINGW)
|
||||
check_symbol_exists("gettimeofday" "sys/time.h" HAVE_GETTIMEOFDAY)
|
||||
endif()
|
||||
if(NOT WIN32)
|
||||
check_symbol_exists("memset_s" "string.h" HAVE_MEMSET_S)
|
||||
if(NOT HAVE_MEMSET_S)
|
||||
|
||||
@@ -396,8 +396,6 @@ case $host in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_FUNCS(gettimeofday)
|
||||
|
||||
dnl Check for memset_s()
|
||||
libssh2_cv_func_memset_s="no"
|
||||
AC_MSG_CHECKING([if memset_s can be linked])
|
||||
|
||||
@@ -51,9 +51,6 @@
|
||||
/* use FIONBIO for non-blocking sockets */
|
||||
#undef HAVE_FIONBIO
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#cmakedefine HAVE_NETINET_IN_H
|
||||
|
||||
/* Functions */
|
||||
#cmakedefine HAVE_GETTIMEOFDAY
|
||||
#cmakedefine HAVE_MEMSET_S
|
||||
#cmakedefine HAVE_MEMSET_EXPLICIT
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#ifdef __MINGW32__
|
||||
# define HAVE_UNISTD_H
|
||||
# define HAVE_INTTYPES_H
|
||||
# define HAVE_GETTIMEOFDAY
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
# define HAVE_INTTYPES_H
|
||||
#endif
|
||||
|
||||
@@ -25,8 +25,6 @@ typedef unsigned int socklen_t; /* missing in headers on VMS */
|
||||
#define HAVE_NETINET_IN_H
|
||||
#define HAVE_ARPA_INET_H
|
||||
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
#define POSIX_C_SOURCE
|
||||
|
||||
/* Enable the possibility of using tracing */
|
||||
|
||||
Reference in New Issue
Block a user