#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;
}
(const char *path, enum dyldErrorSource type, int number)
{
dTHX;
+ dMY_CXT;
char *error;
unsigned int index;
static char *OFIErrorStrings[] =
{
"%s(%d): Object Image Load Failure\n",
"%s(%d): Object Image Load Success\n",
- "%s(%d): Not an recognisable object file\n",
+ "%s(%d): Not a recognisable object file\n",
"%s(%d): No valid architecture\n",
"%s(%d): Object image has an invalid format\n",
"%s(%d): Invalid access (permissions?)\n",
index = number;
if (index > NUM_OFI_ERRORS - 1)
index = NUM_OFI_ERRORS - 1;
- error = form(OFIErrorStrings[index], path, number);
+ error = Perl_form_nocontext(OFIErrorStrings[index], path, number);
break;
default:
- error = form("%s(%d): Totally unknown error type %d\n",
+ error = Perl_form_nocontext("%s(%d): Totally unknown error type %d\n",
path, number, type);
break;
}
{
char *buffer;
int len, maxlen;
+ dTHX;
+ dMY_CXT;
if ( dl_last_error ) {
Safefree(dl_last_error);
}
NXGetMemoryBuffer(s, &buffer, &len, &maxlen);
- New(1097, dl_last_error, len, char);
+ Newx(dl_last_error, len, char);
strcpy(dl_last_error, buffer);
}
char *result;
char **p;
STRLEN n_a;
+ dTHX;
+ dMY_CXT;
/* Do not load what is already loaded into this process */
if (hv_fetch(dl_loaded_files, path, strlen(path), 0))
NXStream *nxerr = OpenError();
unsigned long symref = 0;
- if (!rld_lookup(nxerr, form("_%s", symbol), &symref))
+ if (!rld_lookup(nxerr, Perl_form_nocontext("_%s", symbol), &symref))
TransferError(nxerr);
CloseError(nxerr);
return (void*) symref;
dl_private_init(pTHX)
{
(void)dl_generic_private_init(aTHX);
- dl_resolve_using = get_av("DynaLoader::dl_resolve_using", 0x4);
+ {
+ dMY_CXT;
+ dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI);
+ }
}
MODULE = DynaLoader PACKAGE = DynaLoader
char * symbolname
CODE:
#if NS_TARGET_MAJOR >= 4
- symbolname = form("_%s", symbolname);
+ symbolname = Perl_form_nocontext("_%s", symbolname);
#endif
DLDEBUG(2, PerlIO_printf(Perl_debug_log,
"dl_find_symbol(handle=%lx, symbol=%s)\n",
char *
dl_error()
CODE:
- RETVAL = LastError ;
+ dMY_CXT;
+ RETVAL = dl_last_error ;
OUTPUT:
RETVAL