Description: Allow one to build with older version of libssh2
 Don't fail on missing constants when building with older versions of libssh2
Author: Fab Stz <fabstz-it@yahoo.fr>
Origin: self
Forwarded: not-needed
Last-Update: 2023-06-20

--- a/libssh2/libssh2_wrap.h
+++ b/libssh2/libssh2_wrap.h
@@ -185,11 +185,17 @@ std::wstring formatSshStatusCode(int sc)
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_ENCRYPT);
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_BAD_SOCKET);
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_KNOWN_HOSTS);
+#if LIBSSH2_VERSION_NUM >= 0x010900 // 1.9.0
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_CHANNEL_WINDOW_FULL);
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_KEYFILE_AUTH_FAILED);
+#endif
+#if LIBSSH2_VERSION_NUM >= 0x010A00 // 1.10.0
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_RANDGEN);
+#endif
+#if LIBSSH2_VERSION_NUM >= 0x010B00 // 1.11.0
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_MISSING_USERAUTH_BANNER);
             ZEN_CHECK_CASE_FOR_CONSTANT(LIBSSH2_ERROR_ALGO_UNSUPPORTED);
+#endif
 
         default:
             return replaceCpy<std::wstring>(L"SSH status %x", L"%x", numberTo<std::wstring>(sc));
