*/
/*
- And Gandalf said: 'Many folk like to know beforehand what is to
- be set on the table; but those who have laboured to prepare the
- feast like to keep their secret; for wonder makes the words of
- praise louder.'
-*/
+ * And Gandalf said: 'Many folk like to know beforehand what is to
+ * be set on the table; but those who have laboured to prepare the
+ * feast like to keep their secret; for wonder makes the words of
+ * praise louder.'
+ *
+ * [p.970 of _The Lord of the Rings_, VI/v: "The Steward and the King"]
+ */
/* Porting notes:
return dl_last_error;
}
-static int dlclose(handle) /* stub only */
-void *handle;
+static int dlclose(void *handle) /* stub only */
{
return 0;
}
path, number, type);
break;
}
- safefree(dl_last_error);
- dl_last_error = savepv(error);
+ sv_setpv(MY_CXT.x_dl_last_error, error);
}
static char *dlopen(char *path, int mode /* mode is ignored */)
TranslateError(path, OFImage, dyld_result);
else
{
- // NSLinkModule will cause the run to abort on any link error's
+ // NSLinkModule will cause the run to abort on any link errors
// not very friendly but the error recovery functionality is limited.
handle = NSLinkModule(ofile, path, TRUE);
NSDestroyObjectFileImage(ofile);
}
static void *
-dlsym(handle, symbol)
-void *handle;
-char *symbol;
+dlsym(void *handle, char *symbol)
{
void *addr;
dl_install_xsub(perl_name, symref, filename="$Package")
char * perl_name
void * symref
- char * filename
+ const char * filename
CODE:
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
- ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
- (void(*)(pTHX_ CV *))symref,
- filename)));
+ ST(0) = sv_2mortal(newRV((SV*)newXS_flags(perl_name,
+ (void(*)(pTHX_ CV *))symref,
+ filename, NULL,
+ XS_DYNAMIC_FILENAME)));
char *
OUTPUT:
RETVAL
+#if defined(USE_ITHREADS)
+
+void
+CLONE(...)
+ CODE:
+ MY_CXT_CLONE;
+
+ /* MY_CXT_CLONE just does a memcpy on the whole structure, so to avoid
+ * using Perl variables that belong to another thread, we create our
+ * own for this thread.
+ */
+ MY_CXT.x_dl_last_error = newSVpvn("", 0);
+
+#endif
+
# end.