__UNDEFINED__ my_strnlen SvUOK

__UNDEFINED__ sv_setuv(sv, uv) \ STMT_START { \ UV TeMpUv = uv; \ if (TeMpUv <= IV_MAX) \ sv_setiv(sv, TeMpUv); \ else \ sv_setnv(sv, (double)TeMpUv); \ } STMT_END

__UNDEFINED__ newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))

#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) __UNDEFINED__ sv_2uv(sv) ({ SV *_sv = (sv); (UV) (SvNOK(_sv) ? SvNV(_sv) : sv_2nv(_sv)); }) #else __UNDEFINED__ sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv))) #endif

__UNDEFINED__ SvUVX(sv) ((UV)SvIVX(sv)) __UNDEFINED__ SvUVXx(sv) SvUVX(sv) __UNDEFINED__ SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))

#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) __UNDEFINED__ SvUVx(sv) ({ SV *_sv = (sv)); SvUV(_sv); }) #else __UNDEFINED__ SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv)) #endif

/* Hint: sv_uv * Always use the SvUVx() macro instead of sv_uv(). */ /* Replace sv_uv with SvUVx */ __UNDEFINED__ sv_uv(sv) SvUVx(sv)

#if !defined(SvUOK) && defined(SvIOK_UV) # define SvUOK(sv) SvIOK_UV(sv) #endif

__UNDEFINED__ XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) ) __UNDEFINED__ XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END

__UNDEFINED__ PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END __UNDEFINED__ XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END

#if !defined(my_strnlen) #if { NEED my_strnlen }

Size_t my_strnlen(const char *str, Size_t maxlen) { const char *p = str;

while(maxlen-- && *p)
    p++;

return p - str;
}

#endif #endif

#define NEED_my_strnlen

SV * sv_setuv(uv) UV uv CODE: RETVAL = newSViv(1); sv_setuv(RETVAL, uv); OUTPUT: RETVAL

SV * newSVuv(uv) UV uv CODE: RETVAL = newSVuv(uv); OUTPUT: RETVAL

UV sv_2uv(sv) SV *sv CODE: RETVAL = sv_2uv(sv); OUTPUT: RETVAL

UV SvUVx(sv) SV *sv CODE: sv--; RETVAL = SvUVx(++sv); OUTPUT: RETVAL

void XSRETURN_UV() PPCODE: XSRETURN_UV(42);

void PUSHu() PREINIT: dTARG; PPCODE: TARG = sv_newmortal(); EXTEND(SP, 1); PUSHu(42); XSRETURN(1);

void XPUSHu() PREINIT: dTARG; PPCODE: TARG = sv_newmortal(); XPUSHu(43); XSRETURN(1);

STRLEN my_strnlen(s, max) char * s STRLEN max CODE: RETVAL= my_strnlen(s, max); OUTPUT: RETVAL

BEGIN { require warnings if "$]" > '5.006' }

is(&Devel::PPPort::sv_setuv(42), 42); is(&Devel::PPPort::newSVuv(123), 123); is(&Devel::PPPort::sv_2uv("4711"), 4711); is(&Devel::PPPort::sv_2uv("1735928559"), 1735928559); is(&Devel::PPPort::SvUVx("1735928559"), 1735928559); is(&Devel::PPPort::SvUVx(1735928559), 1735928559); is(&Devel::PPPort::SvUVx(0xdeadbeef), 0xdeadbeef); is(&Devel::PPPort::XSRETURN_UV(), 42); is(&Devel::PPPort::PUSHu(), 42); is(&Devel::PPPort::XPUSHu(), 43); is(&Devel::PPPort::my_strnlen("abc\0def", 7), 3);

5 POD Errors

The following errors were encountered while parsing the POD:

Around line 12:

Unknown directive: =provides

Around line 18:

Unknown directive: =implementation

Around line 80:

Unknown directive: =xsinit

Around line 84:

Unknown directive: =xsubs

Around line 153:

Unknown directive: =tests