cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: version number helper macros?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 17 May 2015 00:36:38 +0200 (CEST)

On Sat, 16 May 2015, Ray Satiro via curl-library wrote:

> I don't have any opinion on the macros but I'm curious about such a
> situation as described in the stackoverflow question. He doesn't strictly
> need to get the version does he? If you're working with an option that you
> know may not be recognized by the shared library and you know roughly what
> you version you have at build time (I assume this based on the way he asked,
> but it's unclear) couldn't you just test against unknown option like:
> fallback = (curl_easy_setopt(curl, CURLOPT_XOAUTH2_BEARER, token) ==
> CURLE_UNKNOWN_OPTION);

Yes, for that specific use case it certinly could be done similar to your
version - in case he's fine with a run-time detection at thay point in time.

I do however recognize that there are legitimate times when you might want to
act differently based on the version number and then having us help the users
do those checks correct could be sensible.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-05-17