curl-users
Calling convention
Date: Thu, 01 Nov 2007 15:58:52 +0100
As it is now all applications using libcurl (either dynamically or
the static lib) must be built with the same calling convention as
libcurl was built with. Normally this would be 'cdecl' (which is
implicit and the only (?) possible calling-convention in gcc).
Sometimes mixing e.g. 'fastcall', 'stdcall' and 'cdecl' would be
useful. I guess this would be an issue only on Windows and DOS
using non-gcc compilers.
But this would mean we should declare the calling-convention on
all public libcurl functions and function-pointer types.
E.g. in <curl/curl.h>:
#if !defined(CURL_CCONV)
#if (defined(__WATCOMC__) || defined(_MSC_VER))
#define CURL_CCONV __fastcall /* or __cdecl */
#else
#define CURL_CCONV
#endif
#endif
...
typedef int (*CURL_CCONV curl_sockopt_callback)(void *clientp,
curl_socket_t curlfd,
curlsocktype purpose);
...
CURL_EXTERN CURLcode CURL_CCONV curl_global_init(long flags);
...
Should we proceed with this idea? Any comments on the pros and cons.
--gv
Received on 2007-11-01