Subject: | Patch to fix 1.4 to build with PERL 5.6.1 |
Due to changes in the PERL XS variable naming scheme (presumed to have happened with 5.6),
several changes to the typemap and API.xs files are needed to build perldap with perl v5.6.1.
The attached patch provides those fixes and the result has been successfully tested both with
the test package provided as well as against several current LDAP servers I have access to.
--Kurt Andersen
*** typemap.orig Thu Feb 7 11:36:46 2002
--- typemap Thu Feb 7 11:37:35 2002
***************
*** 54,64 ****
#########
INPUT
T_timeval
! $var.tv_sec = atof((char *)SvPV($arg,na));
$var.tv_usec = 0
T_berval
! $var.bv_val = (char *)SvPV($arg,na);
! $var.bv_len = na
T_charptrptr
$var = (char **)avref2charptrptr($arg)
T_bervalptrptr
--- 54,64 ----
#########
INPUT
T_timeval
! $var.tv_sec = atof((char *)SvPV($arg,PL_na));
$var.tv_usec = 0
T_berval
! $var.bv_val = (char *)SvPV($arg,PL_na);
! $var.bv_len = PL_na
T_charptrptr
$var = (char **)avref2charptrptr($arg)
T_bervalptrptr
*** API.xs.orig Thu Feb 7 11:02:26 2002
--- API.xs Thu Feb 7 11:48:20 2002
***************
*** 194,200 ****
for (ix_av = 0;ix_av <= avref_arraylen;ix_av++)
{
current_val = av_fetch((AV *)SvRV(avref),ix_av,0);
! tmp_cpp[ix_av] = StrDup(SvPV(*current_val,NA));
}
tmp_cpp[ix_av] = NULL;
--- 194,200 ----
for (ix_av = 0;ix_av <= avref_arraylen;ix_av++)
{
current_val = av_fetch((AV *)SvRV(avref),ix_av,0);
! tmp_cpp[ix_av] = StrDup(SvPV(*current_val,PL_na));
}
tmp_cpp[ix_av] = NULL;
***************
*** 224,230 ****
New(1,tmp_ber[ix_av],1,struct berval);
current_val = av_fetch((AV *)SvRV(avref),ix_av,0);
! tmp_char = SvPV(*current_val,NA);
val_len = SvCUR(*current_val);
Newz(1,tmp2,val_len+1,char);
--- 224,230 ----
New(1,tmp_ber[ix_av],1,struct berval);
current_val = av_fetch((AV *)SvRV(avref),ix_av,0);
! tmp_char = SvPV(*current_val,PL_na);
val_len = SvCUR(*current_val);
Newz(1,tmp2,val_len+1,char);
***************
*** 366,372 ****
} else {
if (cont)
return NULL;
! if (strcmp(SvPV(ldap_value_ref,NA),"") == 0)
{
if (ldap_add_func != 1)
{
--- 366,372 ----
} else {
if (cont)
return NULL;
! if (strcmp(SvPV(ldap_value_ref,PL_na),"") == 0)
{
if (ldap_add_func != 1)
{
***************
*** 383,389 ****
ldap_current_mod->mod_op = LDAP_MOD_REPLACE;
}
New(1,ldap_current_mod->mod_values,2,char *);
! ldap_current_mod->mod_values[0] = StrDup(SvPV(ldap_value_ref,NA));
ldap_current_mod->mod_values[1] = NULL;
}
}
--- 383,389 ----
ldap_current_mod->mod_op = LDAP_MOD_REPLACE;
}
New(1,ldap_current_mod->mod_values,2,char *);
! ldap_current_mod->mod_values[0] = StrDup(SvPV(ldap_value_ref,PL_na));
ldap_current_mod->mod_values[1] = NULL;
}
}
***************
*** 1716,1722 ****
hv_store(FullHash,options_key,strlen(options_key),options,0);
ldap_free_urldesc(realcomp);
} else {
! RETVAL = &sv_undef;
}
}
OUTPUT:
--- 1716,1722 ----
hv_store(FullHash,options_key,strlen(options_key),options,0);
ldap_free_urldesc(realcomp);
} else {
! RETVAL = &PL_sv_undef;
}
}
OUTPUT: