#endif
#if !defined(Perl_atof) && defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
-# if !defined(Perl_atof) && defined(HAS_STRTOLD)
+# if !defined(Perl_atof) && defined(HAS_STRTOLD)
# define Perl_atof(s) strtold(s, (char**)NULL)
# endif
# if !defined(Perl_atof) && defined(HAS_ATOLF)
#endif /* !USE_LOCALE_NUMERIC */
-#if !defined(Atol) && defined(IV_IS_QUAD) && QUADKIND == QUAD_IS_LONG_LONG
+#if !defined(Atol) && defined(USE_64_BIT_INT) && defined(IV_IS_QUAD) && QUADKIND == QUAD_IS_LONG_LONG
# ifdef __hpux
# define strtoll __strtoll /* secret handshake */
# endif
# define Atol atol /* we assume atol being available anywhere */
#endif
-#if !defined(Strtoul) && defined(UV_IS_QUAD) && QUADKIND == QUAD_IS_LONG_LONG
+#if !defined(Strtoul) && defined(USE_64_BIT_INT) && defined(UV_IS_QUAD) && QUADKIND == QUAD_IS_LONG_LONG
# ifdef __hpux
# define strtoull __strtoull /* secret handshake */
# endif
#if !defined(Strtoul)
# define Strtoul strtoul /* we assume strtoul being available anywhere */
#endif
+#ifndef Atoul
+# define Atoul Strtoul
+#endif
#if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)
/*
*/
if (!floatit) {
- char *tp;
IV iv;
UV uv;
errno = 0;
-#ifdef USE_64_BIT_INT
- if (*PL_tokenbuf == '-')
- iv = strtoll(PL_tokenbuf,&tp,10);
- else
- uv = strtoull(PL_tokenbuf,&tp,10);
-#else
if (*PL_tokenbuf == '-')
- iv = strtol(PL_tokenbuf,&tp,10);
+ iv = Atol(PL_tokenbuf);
else
- uv = strtoul(PL_tokenbuf,&tp,10);
-#endif
- if (*tp || errno)
+ uv = Atoul(PL_tokenbuf);
+ if (errno)
floatit = TRUE; /* probably just too large */
else if (*PL_tokenbuf == '-')
sv_setiv(sv, iv);
if (floatit) {
char *tp;
errno = 0;
-/* For some reason VMS doesn't have strrold at the moment. Dunno why */
-#if defined(USE_LONG_DOUBLE) && (defined(HAS_STRTOLD) || !defined(VMS))
- value = strtold(PL_tokenbuf,&tp);
-#else
- value = strtod(PL_tokenbuf,&tp);
-#endif
- if (*tp || errno)
+ value = Atof(PL_tokenbuf);
+ if (errno)
Perl_die(aTHX_ "unparseable float");
else
sv_setnv(sv, value);