Re: [PATCH 7/7] Do not use curl_easy_strerror with curl < 7.12.0
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Apr 13, 2017, 10:52 UTC
- Message-ID
- <CA+P7+xpnbcaJ8ucxfF9pGiN6=72jbq=EvRfX1qKOkG_QjWh+DA@mail.gmail.com>
- In-Reply-To
- <xmqqbms0q0s3.fsf@gitster.mtv.corp.google.com>
On Wed, Apr 12, 2017 at 11:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> On Wed, Apr 05, 2017 at 03:04:24PM +0200, Tom G. Christensen wrote:
>> ...
>> These kinds of interleaved conditionals make me nervous that we'll get
>> something wrong (especially without braces, it's not immediately clear
>> that both sides are a single statement).
>>
>> I wonder if it would be more readable to do something like:
>>
>> #if LIBCURL_VERSION_NUM < 0x070c00
>> static const char *curl_easy_strerror(CURL *curl)
>> {
>> return "[error code unavailable; curl version too old]";
>> }
>> #endif
>>
>> Then callers don't have to individually deal with the ifdef. It does
>> mean that the user sees that kind-of ugly message, but maybe that is a
>> good thing. They know they need to upgrade curl to see more details.
>
> Yup, thanks for a very good suggestion.I also think this is a good solution..
Thanks, Jake