Tim Bunce <[EMAIL PROTECTED]> writes:
> (Any need adding to Driver.xst?)
No. It only contains XS functions and these always get my_perl passed
(which is wasted unless PERL_NO_GET_CONTEXT is used), but if we also
patch up Driver_xst.h then drivers are free to add PERL_NO_GET_CONTEXT
if/when they care.
I tried it with DBD-mysql-3.0002 and it compiled&tested fine when all
I did was adding "#define PERL_NO_GET_CONTEXT\n" at the start of its
mysql.xs file. Seems almost too easy :)
--Gisle
Index: Driver_xst.h
--- Driver_xst.h.~1~ Thu Jan 26 11:11:17 2006
+++ Driver_xst.h Thu Jan 26 11:11:17 2006
@@ -9,6 +9,7 @@
static SV *
dbixst_bounce_method(char *methname, int params)
{
+ dTHX;
/* XXX this 'magic' undoes the dMARK embedded in the dXSARGS of our caller
*/
/* so that the dXSARGS below can set things up as they were for our caller
*/
void *xxx = PL_markstack_ptr++;
@@ -46,6 +47,7 @@
/* Handle binding supplied values to placeholders. */
/* items = one greater than the number of params */
/* ax = ax from calling sub, maybe adjusted to match items */
+ dTHX;
int i;
SV *idx;
if (items-1 != DBIc_NUM_PARAMS(imp_sth)
@@ -75,6 +77,7 @@
static SV *
dbdxst_fetchall_arrayref(SV *sth, SV *slice, SV *batch_row_count)
{
+ dTHX;
D_imp_sth(sth);
SV *rows_rvav;
if (SvOK(slice)) { /* should never get here */
Index: Perl.xs
--- Perl.xs.~1~ Thu Jan 26 11:11:17 2006
+++ Perl.xs Thu Jan 26 11:11:17 2006
@@ -2,6 +2,7 @@
that the Driver.xst mechansim doesn't have compile-time errors in it.
*/
+#define PERL_NO_GET_CONTEXT
#include "DBIXS.h"
#include "dbd_xsh.h"
@@ -38,6 +39,7 @@
int /* just to test syntax of macros etc */
dbd_st_rows(SV *h, imp_sth_t *imp_sth)
{
+ dTHX;
DBIh_SET_ERR_CHAR(h, imp_sth, 0, 1, "err msg", "12345", Nullch);
return -1;
}
End of Patch.