#include "config.h"
#define CURL_NO_OLDIES 1
+
+/*
+ * We have to use this as curl uses lots of enums
+ */
+#ifndef CURL_AT_LEAST_VERSION
+# define CURL_VERSION_BITS(x, y, z) ((x) << 16 | (y) << 8 | z)
+# define CURL_AT_LEAST_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
+#endif
+
#include <curl/curl.h>
/*
///< libcurl will use whatever it thinks fit.
{ "1.0", CURL_HTTP_VERSION_1_0 }, //!< Enforce HTTP 1.0 requests.
{ "1.1", CURL_HTTP_VERSION_1_1 }, //!< Enforce HTTP 1.1 requests.
-#ifdef CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE
+/*
+ * These are all enum values
+ */
+#if CURL_AT_LEAST_VERSION(7,49,0)
{ "2.0", CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE }, //!< Enforce HTTP 2.0 requests.
#endif
-#ifdef CURL_HTTP_VERSION_2_0
+#if CURL_AT_LEAST_VERSION(7,33,0)
{ "2.0+auto", CURL_HTTP_VERSION_2_0 }, //!< Attempt HTTP 2 requests. libcurl will fall back
///< to HTTP 1.1 if HTTP 2 can't be negotiated with the
///< server. (Added in 7.33.0)
#endif
-#ifdef CURL_HTTP_VERSION_2TLS
+#if CURL_AT_LEAST_VERSION(7,47,0)
{ "2.0+tls", CURL_HTTP_VERSION_2TLS }, //!< Attempt HTTP 2 over TLS (HTTPS) only.
///< libcurl will fall back to HTTP 1.1 if HTTP 2
///< can't be negotiated with the HTTPS server.