Fixes for the test suite on OS/2
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / typemap
index bce6227..2c35437 100644 (file)
@@ -14,8 +14,9 @@ const char *          T_PV
 caddr_t                        T_PV
 wchar_t *              T_PV
 wchar_t                        T_IV
+# bool_t is defined in <rpc/rpc.h>
 bool_t                 T_IV
-size_t                 T_IV
+size_t                 T_UV
 ssize_t                        T_IV
 time_t                 T_NV
 unsigned long *                T_OPAQUEPTR
@@ -34,7 +35,7 @@ NV                      T_NV
 I32                    T_IV
 I16                    T_IV
 I8                     T_IV
-STRLEN                 T_IV
+STRLEN                 T_UV
 U32                    T_U_LONG
 U16                    T_U_SHORT
 U8                     T_UV
@@ -60,22 +61,30 @@ T_SVREF
        if (SvROK($arg))
            $var = (SV*)SvRV($arg);
        else
-           Perl_croak(aTHX_ \"$var is not a reference\")
+           Perl_croak(aTHX_ \"%s: %s is not a reference\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\")
 T_AVREF
        if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVAV)
            $var = (AV*)SvRV($arg);
        else
-           Perl_croak(aTHX_ \"$var is not an array reference\")
+           Perl_croak(aTHX_ \"%s: %s is not an array reference\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\")
 T_HVREF
        if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVHV)
            $var = (HV*)SvRV($arg);
        else
-           Perl_croak(aTHX_ \"$var is not a hash reference\")
+           Perl_croak(aTHX_ \"%s: %s is not a hash reference\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\")
 T_CVREF
        if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVCV)
            $var = (CV*)SvRV($arg);
        else
-           Perl_croak(aTHX_ \"$var is not a code reference\")
+           Perl_croak(aTHX_ \"%s: %s is not a code reference\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\")
 T_SYSRET
        $var NOT IMPLEMENTED
 T_UV
@@ -99,7 +108,7 @@ T_LONG
 T_U_LONG
        $var = (unsigned long)SvUV($arg)
 T_CHAR
-       $var = (char)*SvPV($arg,PL_na)
+       $var = (char)*SvPV_nolen($arg)
 T_U_CHAR
        $var = (unsigned char)SvUV($arg)
 T_FLOAT
@@ -109,7 +118,7 @@ T_NV
 T_DOUBLE
        $var = (double)SvNV($arg)
 T_PV
-       $var = ($type)SvPV($arg,PL_na)
+       $var = ($type)SvPV_nolen($arg)
 T_PTR
        $var = INT2PTR($type,SvIV($arg))
 T_PTRREF
@@ -118,28 +127,36 @@ T_PTRREF
            $var = INT2PTR($type,tmp);
        }
        else
-           Perl_croak(aTHX_ \"$var is not a reference\")
+           Perl_croak(aTHX_ \"%s: %s is not a reference\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\")
 T_REF_IV_REF
        if (sv_isa($arg, \"${ntype}\")) {
            IV tmp = SvIV((SV*)SvRV($arg));
            $var = *INT2PTR($type *, tmp);
        }
        else
-           Perl_croak(aTHX_ \"$var is not of type ${ntype}\")
+           Perl_croak(aTHX_ \"%s: %s is not of type %s\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\", \"$ntype\")
 T_REF_IV_PTR
        if (sv_isa($arg, \"${ntype}\")) {
            IV tmp = SvIV((SV*)SvRV($arg));
            $var = INT2PTR($type, tmp);
        }
        else
-           Perl_croak(aTHX_ \"$var is not of type ${ntype}\")
+           Perl_croak(aTHX_ \"%s: %s is not of type %s\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\", \"$ntype\")
 T_PTROBJ
        if (sv_derived_from($arg, \"${ntype}\")) {
            IV tmp = SvIV((SV*)SvRV($arg));
            $var = INT2PTR($type,tmp);
        }
        else
-           Perl_croak(aTHX_ \"$var is not of type ${ntype}\")
+           Perl_croak(aTHX_ \"%s: %s is not of type %s\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\", \"$ntype\")
 T_PTRDESC
        if (sv_isa($arg, \"${ntype}\")) {
            IV tmp = SvIV((SV*)SvRV($arg));
@@ -147,25 +164,31 @@ T_PTRDESC
            $var = ${type}_desc->ptr;
        }
        else
-           Perl_croak(aTHX_ \"$var is not of type ${ntype}\")
+           Perl_croak(aTHX_ \"%s: %s is not of type %s\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\", \"$ntype\")
 T_REFREF
        if (SvROK($arg)) {
            IV tmp = SvIV((SV*)SvRV($arg));
            $var = *INT2PTR($type,tmp);
        }
        else
-           Perl_croak(aTHX_ \"$var is not a reference\")
+           Perl_croak(aTHX_ \"%s: %s is not a reference\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\")
 T_REFOBJ
        if (sv_isa($arg, \"${ntype}\")) {
            IV tmp = SvIV((SV*)SvRV($arg));
            $var = *INT2PTR($type,tmp);
        }
        else
-           Perl_croak(aTHX_ \"$var is not of type ${ntype}\")
+           Perl_croak(aTHX_ \"%s: %s is not of type %s\",
+                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
+                       \"$var\", \"$ntype\")
 T_OPAQUE
-       $var = *($type *)SvPV($arg,PL_na)
+       $var = *($type *)SvPV_nolen($arg)
 T_OPAQUEPTR
-       $var = ($type)SvPV($arg,PL_na)
+       $var = ($type)SvPV_nolen($arg)
 T_PACKED
        $var = XS_unpack_$ntype($arg)
 T_PACKEDARRAY