Path out _difftime64() dependency.
This commit is contained in:
parent
f71e83ebda
commit
7635f07d49
1
build.sh
1
build.sh
@ -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
22
patch/ssh2_session.diff
Normal 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");
|
Loading…
Reference in New Issue
Block a user