httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject ap_cleanup_fn_t (was: ap_file_t typedef)
Date Mon, 03 Apr 2000 20:44:51 GMT
On Mon, 3 Apr 2000, William A. Rowe, Jr. wrote:
>...
> It replaces declarations like this;
> 
> ap_status_t ap_set_userdata(void *data, char *key,
>                             ap_status_t (*cleanup) (void *),
>                             ap_context_t *cont);
> 
> with
> 
> ap_status_t ap_set_userdata(void *data, char *key,
>                             ap_cleanup_fn_t *cleanup,
>                             ap_context_t *cont);

+1

[related to the APR_THREAD_FUNC macro...]
> And it's ABSOLUTELY CRITICAL on the windows platform that the
> callback function model matches the callback pointer declaration.
> This isn't the only place in Apache we use this convention.
> 
> Under non-Win32, the noop is declared:
> 
> #define APR_THREAD_FUNC
> 
> Under Win32, depending on how Win32 is built, it looks like:
> 
> #define APR_THREAD_FUNC _stdcall
> 
> under another build, it might read
> 
> #define APR_THREAD_FUNC _cdecl
> 
> But the model must match for both the APR build and the client build.
> 
> There are tradeoffs to the two models, and I'm not making the arguement for
> either, just for the consistency that this structure imposes.

I am failing to see why we need to have an option to build Apache under
different calling models. IMO, we should specify a model (cdecl), set the
compiler command-line switch, and toss macros like APR_THREAD_FUNC.

Where the Win32 code needs a _stdcall callback, that is going to happen in
APR most likely. That callback can explicitly use _stdcall. Otherwise,
let's keep the code clean and toss stuff like APR_THREAD_FUNC.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message