Jian,

I’m not sure what you’re trying to accomplish. CURL_VERSION_UNIX_SOCKETS is a 
bit flag for features – not a version.

Try this:

    auto data = curl_version_info(CURLVERSION_NOW);
    printf("Curl version: %s\n", data->version);

    if (data->features & CURL_VERSION_UNIX_SOCKETS)
        printf("Curl supports UNIX sockets.\n");
    else
        printf("Curl does NOT support UNIX sockets.\n");


-Matt
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: jian he via curl-library<mailto:curl-library@lists.haxx.se>
Sent: Sunday, October 2, 2022 5:39 AM
To: curl-library@lists.haxx.se<mailto:curl-library@lists.haxx.se>
Cc: jian he<mailto:jian.universal...@gmail.com>
Subject: How to printout CURL_VERSION_UNIX_SOCKETS

Hello world.

In curl.h
#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */

In https://curl.se/libcurl/c/curl_version_info.html

CURL_VERSION_UNIX_SOCKETS

libcurl was built with support for Unix domain sockets. (Added in 7.40.0)
So from here, we can print out CURL_VERSION_UNIX_SOCKETS to 7.40.0?

Here is what I tried:
    printf("CURL_VERSION_UNIX_SOCKETS  version: %u.%u.%u\n"
        ,(CURL_VERSION_UNIX_SOCKETS >> 19 ) & 0xff
        ,(CURL_VERSION_UNIX_SOCKETS  >> 16) & 0xff
        ,(CURL_VERSION_UNIX_SOCKETS >> 8) & 0xff
    );

it print out: CURL_VERSION_UNIX_SOCKETS  version: 1.8.0

So it failed.
overall, I don't understand: #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix 
domain sockets support */


--
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian



-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to