Justin Erenkrantz wrote:
> On 12/25/06, William A. Rowe, Jr. <[EMAIL PROTECTED]> wrote:
>> Just so folks are aware why...
>>
>> >> > +APU_DECLARE_DATA const apr_bucket_type_t bucket_type_diskcache = {
>> >> > + "DISKCACHE", 5, APR_BUCKET_DATA,
>> >> > + diskcache_bucket_destroy,
>> >> > + diskcache_bucket_read,
>> >> > + diskcache_bucket_setaside,
>> >> > + apr_bucket_shared_split,
>> >> > + apr_bucket_shared_copy
>> >> > +};
>>
>> results in...
>>
>> >> .\mod_disk_cache.c(251) : error C2491: 'bucket_type_diskcache' :
>> >> definition of dllimport data not allowed
>>
>> ...the APU_DECLARE_DATA means "This exported data symbol is provided by
>> APR-UTIL".
>>
>> APR-UTIL does not include the source mod_disk_cache.c.
>>
>> Ergo - fubar.
>
> FWIW, I tried CACHE_DECLARE_DATA too and it made no difference. -- justin
is mod_disk_cache.c compiled into mod_cache.so? Nope :)
AP_MODULE_DECLARE_DATA is a funky one-off entity that's perfect for this...
it is an "always export" declaration. Lousy for adding to a .h file (you need
to give the module it's own macro set, see mod_dav for one example), but it's
just perfect for exported private data, such as...
module AP_MODULE_DECLARE_DATA isapi_module = {
STANDARD20_MODULE_STUFF,
create_isapi_dir_config, /* create per-dir config */
merge_isapi_dir_configs, /* merge per-dir config */
NULL, /* server config */
NULL, /* merge server config */
isapi_cmds, /* command apr_table_t */
isapi_hooks /* register hooks */
};