From: gfx Date: Fri, 10 Sep 2010 04:01:46 +0000 (+0900) Subject: Fix LooksLikeNumber() macro X-Git-Tag: 0.66~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=339fdf5bcb2d9f26f1be88631552e7b887e778a8;p=gitmo%2FMouse.git Fix LooksLikeNumber() macro --- diff --git a/perlxs.h b/perlxs.h index 4168cd3..c676c94 100644 --- a/perlxs.h +++ b/perlxs.h @@ -60,10 +60,10 @@ extern "C" { /* general utility */ -#if PERL_BCDVERSION < 0x5008005 -#define LooksLikeNumber(x) (SvOK(x) && looks_like_number(x)) -#else +#if PERL_BCDVERSION >= 0x5008005 #define LooksLikeNumber(x) looks_like_number(x) +#else +#define LooksLikeNumber(x) (SvPOKp(x) ? looks_like_number(x) : (I32)SvNIOKp(x)) #endif #define newAV_mortal() (AV*)sv_2mortal((SV*)newAV())