From c71b6a2795791f73fd6ca62abebc74da7104d8e6 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Sat, 6 Feb 2016 17:04:37 -0500 Subject: examples/asiohiper: Avoid function name collision on Windows closesocket => close_socket Winsock already has the former. Bug: https://curl.haxx.se/mail/lib-2016-02/0016.html --- docs/examples/asiohiper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/asiohiper.cpp b/docs/examples/asiohiper.cpp index c9bb99955..d6065e554 100644 --- a/docs/examples/asiohiper.cpp +++ b/docs/examples/asiohiper.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ @@ -378,9 +379,9 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose, } /* CURLOPT_CLOSESOCKETFUNCTION */ -static int closesocket(void *clientp, curl_socket_t item) +static int close_socket(void *clientp, curl_socket_t item) { - fprintf(MSG_OUT, "\nclosesocket : %d", item); + fprintf(MSG_OUT, "\nclose_socket : %d", item); std::map::iterator it = socket_map.find(item); @@ -427,7 +428,7 @@ static void new_conn(char *url, GlobalInfo *g) curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket); /* call this function to close a socket */ - curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket); + curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, close_socket); fprintf(MSG_OUT, "\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url); @@ -441,7 +442,6 @@ static void new_conn(char *url, GlobalInfo *g) int main(int argc, char **argv) { GlobalInfo g; - CURLMcode rc; (void)argc; (void)argv; -- cgit v1.2.3