Re: [PATCH v3] http: use xmalloc with cURL
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 15, 2019, 22:18 UTC
- Message-ID
- <xmqqblwq2hu2.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190815214429.28048-1-carenas@gmail.com>
Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
Show 6 quoted lines
> #if LIBCURL_VERSION_NUM < 0x070800
> #define curl_global_init(a) do { /* nothing */ } while (0)
> +#elif LIBCURL_VERSION_NUM >= 0x070c00
> +#define curl_global_init(a) curl_global_init_mem(a, xmalloc, free, \
> + xrealloc, xstrdup, xcalloc)
> #endifYup. That looks better.
If your curl version is recent enough (which presumably is true for most people these days), the entire #if/#endif block is skipped while scanning for #else or #elif and #elseif willq be silently ignored; it is unfortunate that #elseif won't be flagged by CPP as a potential error X-<.