commit 26c6ba57bd2939d6f15e7e59419bdd5e05bf2097
parent f7747015d8dc0d362fa3fb2cc7670d5a690edef8
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Wed, 5 Oct 2022 11:53:39 +0300
test_https_session_info: fixed compiler warning with old libcurl
Diffstat:
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/testcurl/https/test_https_session_info.c b/src/testcurl/https/test_https_session_info.c
@@ -35,7 +35,8 @@
#include "tls_test_common.h"
#include "tls_test_keys.h"
-struct MHD_Daemon *d;
+#if LIBCURL_VERSION_NUM >= 0x072200
+static struct MHD_Daemon *d;
/*
* HTTP access handler call back
@@ -93,7 +94,6 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
/**
* negotiate a secure connection with server & query negotiated security parameters
*/
-#if LIBCURL_VERSION_NUM >= 0x072200
static unsigned int
test_query_session (void)
{
@@ -183,12 +183,9 @@ test_query_session (void)
}
-#endif
-
int
main (int argc, char *const *argv)
{
-#if LIBCURL_VERSION_NUM >= 0x072200
unsigned int errorCount = 0;
const char *ssl_version;
(void) argc; /* Unused. Silent compiler warning. */
@@ -219,9 +216,19 @@ main (int argc, char *const *argv)
print_test_result (errorCount, argv[0]);
curl_global_cleanup ();
return errorCount != 0 ? 1 : 0;
+}
+
+
#else /* LIBCURL_VERSION_NUM < 0x072200 */
+
+int
+main (int argc, char *const *argv)
+{
(void) argc; (void) argv; /* Unused. Silent compiler warning. */
- (void) query_session_ahc; /* Mute compiler warning */
+ fprintf (stderr, "libcurl version 7.34.0 or later is required.\n" \
+ "Cannot run the test.\n");
return 77;
-#endif /* LIBCURL_VERSION_NUM < 0x072200 */
}
+
+
+#endif /* LIBCURL_VERSION_NUM < 0x072200 */