cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Calling convention

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Fri, 02 Nov 2007 15:19:09 +0100

"Daniel Stenberg" <daniel_at_haxx.se> wrote:

> Sorry for being thick, but why do applicatons have to use the same calling
> convention as libcurl? Aren't all the libcurl functions "tagged" accordingly
> with the convention?

Don't quite follow you, but the only "tagging" now is the import declaration
(CURL_EXTERN). Apps now needs to use the same calling convention as libcurl
since symbols are decorated/mangled differently. E.g. in MSVC or Watcom using
fastcall, "curl_easy_perform" becomes "@curl_easy_perform_at_4". Hence not
specifying the cconv directly in <curl/*.h> would cause a link-fail.

(The rule for var-arg functions is an exception; they are silently
converted to cdecl decoration).

--gv
Received on 2007-11-02