/* See L<perlguts/"The Perl API"> for detailed notes on
* PERL_IMPLICIT_CONTEXT and PERL_IMPLICIT_SYS */
+#ifdef USE_ITHREADS
+# if !defined(MULTIPLICITY) && !defined(PERL_OBJECT)
+# define MULTIPLICITY
+# endif
+#endif
+
#ifdef USE_THREADS
# ifndef PERL_IMPLICIT_CONTEXT
# define PERL_IMPLICIT_CONTEXT
# endif
#endif
-#if defined(USE_ITHREADS) && !defined(MULTIPLICITY) && !defined(PERL_OBJECT)
-# include "error: USE_ITHREADS must be built with MULTIPLICITY"
-#endif
-
#ifdef PERL_OBJECT
/* PERL_OBJECT explained - DickH and DougL @ ActiveState.com
# define dTHX dTHXa(PERL_GET_THX)
# define pTHX_ pTHX,
# define aTHX_ aTHX,
+# define pTHX_1 2
+# define pTHX_2 3
+# define pTHX_3 4
+# define pTHX_4 5
#endif
#define STATIC static
# define aTHX_
# define dTHXa(a) dNOOP
# define dTHX dNOOP
+# define pTHX_1 1
+# define pTHX_2 2
+# define pTHX_3 3
+# define pTHX_4 4
#endif
#ifndef pTHXo
# define Perl_fmod fmod
#endif
-#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+#if !defined(Perl_atof) && defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
# if !defined(Perl_atof) && defined(HAS_STRTOLD)
-# define Perl_atof(s) strtold(s, (char*)0)
+# define Perl_atof(s) strtold(s, (char**)NULL)
# endif
# if !defined(Perl_atof) && defined(HAS_ATOLF)
# define Perl_atof atolf
# endif
-#else
-# if !defined(Perl_atof) && defined(HAS_STRTOD)
-# define Perl_atof(s) strtod(s, (char*)0)
-# endif
-# if !defined(Perl_atof)
-# define Perl_atof atof /* we assume atof being available anywhere */
-# endif
+#endif
+#if !defined(Perl_atof)
+# define Perl_atof atof /* we assume atof being available anywhere */
#endif
/* Previously these definitions used hardcoded figures.
# endif
#endif
+#ifndef SVf
+# ifdef CHECK_FORMAT
+# define SVf "p"
+# else
+# define SVf "_"
+# endif
+#endif
+
/* Some unistd.h's give a prototype for pause() even though
HAS_PAUSE ends up undefined. This causes the #define
below to be rejected by the compmiler. Sigh.
#define U_V(what) (cast_uv((NV)(what)))
#endif
+/* Mention NV_PRESERVES_UV so that Configure picks it up. */
+
/* These do not care about the fractional part, only about the range. */
#define NV_WITHIN_IV(nv) (I_V(nv) >= IV_MIN && I_V(nv) <= IV_MAX)
#define NV_WITHIN_UV(nv) ((nv)>=0.0 && U_V(nv) >= UV_MIN && U_V(nv) <= UV_MAX)
#endif /* !USE_LOCALE_NUMERIC */
-#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG)
+#if !defined(Atol) && defined(USE_LONG_LONG) && defined(HAS_LONG_LONG)
+# if !defined(Atol) && defined(HAS_STRTOLL)
+# define Atol(s) strtoll(s, (char**)NULL, 10)
+# endif
# if !defined(Atol) && defined(HAS_ATOLL)
-# define Atol atoll
+# define Atol atoll
# endif
- /* is there atoq() anywhere? */
-#else
+#endif
+/* is there atoq() anywhere? */
+#if !defined(Atol)
# define Atol atol /* we assume atol being available anywhere */
#endif
-#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG)
-# if !defined(Strtoul) && defined(HAS_STRTOULL)
-# define Strtoul strtoull
-# endif
-# if !defined(Strtoul) && defined(HAS_STRTOUQ)
-# define Strtoul strtouq
-# endif
-#else
-# define Strtoul strtoul
+#if !defined(Strtoul) && defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) \
+ && defined(HAS_STRTOULL)
+# define Strtoul strtoull
+#endif
+/* is there atouq() anywhere? */
+#if !defined(Strtoul) && defined(USE_64_BITS) && defined(HAS_STRTOUQ)
+# define Strtoul strtouq
+#endif
+#if !defined(Strtoul)
+# define Strtoul strtoul /* we assume strtoul being available anywhere */
#endif
#if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)