summaryrefslogtreecommitdiff
path: root/ext/DynaLoader/dl_next.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/DynaLoader/dl_next.xs')
-rw-r--r--ext/DynaLoader/dl_next.xs22
1 files changed, 17 insertions, 5 deletions
diff --git a/ext/DynaLoader/dl_next.xs b/ext/DynaLoader/dl_next.xs
index b8c19f203e..405082664d 100644
--- a/ext/DynaLoader/dl_next.xs
+++ b/ext/DynaLoader/dl_next.xs
@@ -44,14 +44,19 @@ Anno Siegel
#define DL_LOADONCEONLY
-#include "dlutils.c" /* SaveError() etc */
+typedef struct {
+ AV * x_resolve_using;
+} my_cxtx_t; /* this *must* be named my_cxtx_t */
+#define DL_CXT_EXTRA /* ask for dl_cxtx to be defined in dlutils.c */
+#include "dlutils.c" /* SaveError() etc */
-static char * dl_last_error = (char *) 0;
-static AV *dl_resolve_using = Nullav;
+#define dl_resolve_using (dl_cxtx.x_resolve_using)
static char *dlerror()
{
+ dTHX;
+ dMY_CXT;
return dl_last_error;
}
@@ -73,6 +78,7 @@ static void TranslateError
(const char *path, enum dyldErrorSource type, int number)
{
dTHX;
+ dMY_CXT;
char *error;
unsigned int index;
static char *OFIErrorStrings[] =
@@ -150,6 +156,7 @@ static void TransferError(NXStream *s)
{
char *buffer;
int len, maxlen;
+ dMY_CXT;
if ( dl_last_error ) {
Safefree(dl_last_error);
@@ -174,6 +181,7 @@ static char *dlopen(char *path, int mode /* mode is ignored */)
char *result;
char **p;
STRLEN n_a;
+ dMY_CXT;
/* Do not load what is already loaded into this process */
if (hv_fetch(dl_loaded_files, path, strlen(path), 0))
@@ -226,7 +234,10 @@ static void
dl_private_init(pTHX)
{
(void)dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
+ {
+ dMY_CXT;
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
+ }
}
MODULE = DynaLoader PACKAGE = DynaLoader
@@ -300,7 +311,8 @@ dl_install_xsub(perl_name, symref, filename="$Package")
char *
dl_error()
CODE:
- RETVAL = LastError ;
+ dMY_CXT;
+ RETVAL = dl_last_error ;
OUTPUT:
RETVAL