From 31d0b1a8530b959bd12c2074dc6e883e1eda8207 Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Mon, 18 Mar 2019 15:07:12 -0700 Subject: [PATCH] Move fallback SIZE_MAX and UINT_MAX to libssh2_priv.h --- include/libssh2.h | 12 ------------ src/libssh2_priv.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/libssh2.h b/include/libssh2.h index cbf86e33..187539c6 100644 --- a/include/libssh2.h +++ b/include/libssh2.h @@ -154,18 +154,6 @@ typedef int libssh2_socket_t; #define LIBSSH2_INVALID_SOCKET -1 #endif /* WIN32 */ -#ifndef SIZE_MAX -#if _WIN64 -#define SIZE_MAX 0xFFFFFFFFFFFFFFFF -#else -#define SIZE_MAX 0xFFFFFFFF -#endif -#endif - -#ifndef UINT_MAX -#define UINT_MAX 0xFFFFFFFF -#endif - /* * Determine whether there is small or large file support on windows. */ diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h index 387b8a77..98d01f2a 100644 --- a/src/libssh2_priv.h +++ b/src/libssh2_priv.h @@ -146,6 +146,18 @@ static inline int writev(int sock, struct iovec *iov, int nvecs) #endif +#ifndef SIZE_MAX +#if _WIN64 +#define SIZE_MAX 0xFFFFFFFFFFFFFFFF +#else +#define SIZE_MAX 0xFFFFFFFF +#endif +#endif + +#ifndef UINT_MAX +#define UINT_MAX 0xFFFFFFFF +#endif + /* RFC4253 section 6.1 Maximum Packet Length says: * * "All implementations MUST be able to process packets with