Path out _difftime64() dependency.

This commit is contained in:
LoRd_MuldeR 2021-06-13 21:58:25 +02:00
parent f71e83ebda
commit 7635f07d49
2 changed files with 23 additions and 0 deletions

View File

@ -123,6 +123,7 @@ pkg_ssh2="$(find "${LIBS_DIR}" -maxdepth 1 -name 'libssh2-*.tar.gz' | sort -rn |
rm -rf "${SSH2_DIR}" && mkdir "${SSH2_DIR}" rm -rf "${SSH2_DIR}" && mkdir "${SSH2_DIR}"
tar -xvf "${pkg_ssh2}" --strip-components=1 -C "${SSH2_DIR}" tar -xvf "${pkg_ssh2}" --strip-components=1 -C "${SSH2_DIR}"
pushd "${SSH2_DIR}" pushd "${SSH2_DIR}"
patch -p1 -b < "${BASE_DIR}/patch/ssh2_session.diff"
CFLAGS="-march=${MY_MARCH} -mtune=${MY_MTUNE} -I${LIBS_DIR}/include" LDFLAGS="-L${LIBS_DIR}/lib" LIBS="-latomic" ./configure --disable-examples-build --disable-shared --with-libz CFLAGS="-march=${MY_MARCH} -mtune=${MY_MTUNE} -I${LIBS_DIR}/include" LDFLAGS="-L${LIBS_DIR}/lib" LIBS="-latomic" ./configure --disable-examples-build --disable-shared --with-libz
make make
cp -v src/.libs/libssh2.a "${LIBS_DIR}/lib" cp -v src/.libs/libssh2.a "${LIBS_DIR}/lib"

22
patch/ssh2_session.diff Normal file
View File

@ -0,0 +1,22 @@
diff --git "a/D:\\_Sandbox\\curl\\libssh2-x64\\src\\session.c.orig" "b/D:\\_Sandbox\\curl\\libssh2-x64\\src\\session.c"
index e439acd..476a497 100644
--- "a/src/session.c"
+++ "b/src/session.c"
@@ -58,6 +58,8 @@
#include "mac.h"
#include "misc.h"
+#define DIFFTIME(X,Y) ((double)((Y) - (X)))
+
/* libssh2_default_alloc
*/
static
@@ -610,7 +612,7 @@ int _libssh2_wait_socket(LIBSSH2_SESSION *session, time_t start_time)
(seconds_to_next == 0 ||
ms_to_next > session->api_timeout)) {
time_t now = time(NULL);
- elapsed_ms = (long)(1000*difftime(now, start_time));
+ elapsed_ms = (long)(1000*DIFFTIME(now, start_time));
if(elapsed_ms > session->api_timeout) {
return _libssh2_error(session, LIBSSH2_ERROR_TIMEOUT,
"API timeout expired");