Fix LooksLikeNumber() macro
gfx [Fri, 10 Sep 2010 04:01:46 +0000 (13:01 +0900)]
perlxs.h

index 4168cd3..c676c94 100644 (file)
--- 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())