Joe Schaefer <[EMAIL PROTECTED]> writes:
> Perhaps using APR_OPTIONAL_FN* will do the trick here?
Proof-of-concept patch below. I don't know how to produce
a BOOT stanza in WrapXS/APR/Pool/Pool.xs, so after applying this patch
you also need to edit that file so the bottom looks like so
% tail WrapXS/APR/Pool/Pool.xs
mpxs_apr_pool_DESTROY(aTHX_ obj);
MODULE = APR::Pool
PROTOTYPES: disabled
BOOT:
items = items; /* -Wall */
mpopt_interp_unselect = APR_RETRIEVE_OPTIONAL_FN(modperl_interp_unselect);
%
Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.214
diff -u -r1.214 mod_perl.c
--- src/modules/perl/mod_perl.c 2 Jun 2004 21:35:58 -0000 1.214
+++ src/modules/perl/mod_perl.c 24 Jun 2004 20:10:06 -0000
@@ -715,6 +715,8 @@
void modperl_register_hooks(apr_pool_t *p)
{
+ APR_REGISTER_OPTIONAL_FN(modperl_interp_unselect);
+
/* for <IfDefine MODPERL2> and Apache->define("MODPERL2") */
*(char **)apr_array_push(ap_server_config_defines) =
apr_pstrdup(p, "MODPERL2");
Index: src/modules/perl/mod_perl.h
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/mod_perl.h,v
retrieving revision 1.66
diff -u -r1.66 mod_perl.h
--- src/modules/perl/mod_perl.h 16 Jun 2004 03:55:47 -0000 1.66
+++ src/modules/perl/mod_perl.h 24 Jun 2004 20:10:06 -0000
@@ -128,4 +128,6 @@
/* we need to hook a few internal things before APR_HOOK_REALLY_FIRST */
#define MODPERL_HOOK_REALLY_REALLY_FIRST (-20)
+APR_DECLARE_OPTIONAL_FN(apr_status_t,modperl_interp_unselect,(void *));
+
#endif /* MOD_PERL_H */
cvs server: Diffing xs/APR
cvs server: Diffing xs/APR/APR
Index: xs/APR/APR/APR.xs
===================================================================
RCS file: /home/cvspublic/modperl-2.0/xs/APR/APR/APR.xs,v
retrieving revision 1.11
diff -u -r1.11 APR.xs
--- xs/APR/APR/APR.xs 16 Jun 2004 03:55:48 -0000 1.11
+++ xs/APR/APR/APR.xs 24 Jun 2004 20:10:06 -0000
@@ -15,12 +15,6 @@
#include "mod_perl.h"
-/* XXX: provide the missing symbol for APR::Pool as a tmp workaround */
-#ifndef modperl_interp_unselect
-apr_status_t modperl_interp_unselect(void *data);
-apr_status_t modperl_interp_unselect(void *data) { return APR_SUCCESS; }
-#endif
-
#ifdef MP_HAVE_APR_LIBS
# define APR_initialize apr_initialize
# define APR_terminate apr_terminate
--
Joe Schaefer
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]