Configure megamaintenance. Cppsym (hopefully) final spasms;
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index fb5409d..14cc107 100644 (file)
--- a/perl.h
+++ b/perl.h
 #define VOIDUSED 1
 #include "config.h"
 
+#if defined(USE_ITHREADS) && defined(USE_5005THREADS)
+#  include "error: USE_ITHREADS and USE_5005THREADS are incompatible"
+#endif
+
+/* XXX This next guard can disappear if the sources are revised
+   to use USE_5005THREADS throughout. -- A.D  1/6/2000
+*/
+#if defined(USE_ITHREADS) && defined(USE_THREADS)
+#  include "error: USE_ITHREADS and USE_THREADS are incompatible"
+#endif
+
 /* 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
@@ -40,6 +57,9 @@
 
 #ifdef PERL_CAPI
 #  undef PERL_OBJECT
+#  ifndef MULTIPLICITY
+#    define MULTIPLICITY
+#  endif
 #  ifndef PERL_IMPLICIT_CONTEXT
 #    define PERL_IMPLICIT_CONTEXT
 #  endif
@@ -171,6 +191,10 @@ struct perl_thread;
 #  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
@@ -203,6 +227,10 @@ struct perl_thread;
 #  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
@@ -1071,10 +1099,16 @@ typedef NVTYPE NV;
 #   define Perl_fmod fmod
 #endif
 
-#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_ATOLF)
-#   define Perl_atof atolf
-#else
-#   define Perl_atof atof
+#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**)NULL)
+#   endif
+#   if !defined(Perl_atof) && defined(HAS_ATOLF)
+#       define Perl_atof atolf
+#   endif
+#endif
+#if !defined(Perl_atof)
+#   define Perl_atof atof /* we assume atof being available anywhere */
 #endif
 
 /* Previously these definitions used hardcoded figures. 
@@ -1470,10 +1504,6 @@ typedef struct ptr_tbl PTR_TBL_t;
 #  define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)
 #endif
 
-#ifndef PERL_SYS_INIT3
-#  define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)
-#endif
-
 #ifndef MAXPATHLEN
 #  ifdef PATH_MAX
 #    ifdef _POSIX_PATH_MAX
@@ -1598,7 +1628,13 @@ typedef pthread_key_t    perl_key;
 #define PERL_EXIT_EXPECTED     0x01
 
 #ifndef MEMBER_TO_FPTR
-#define MEMBER_TO_FPTR(name)           name
+#  define MEMBER_TO_FPTR(name)         name
+#endif
+
+/* format to use for version numbers in file/directory names */
+/* XXX move to Configure? */
+#ifndef PERL_FS_VER_FMT
+#  define PERL_FS_VER_FMT      "%d.%d.%d"
 #endif
 
 /* This defines a way to flush all output buffers.  This may be a
@@ -1648,6 +1684,14 @@ typedef pthread_key_t    perl_key;
 #  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.
@@ -2421,7 +2465,7 @@ enum {            /* pass one of these to get_vtbl */
 #define HINT_INTEGER           0x00000001
 #define HINT_STRICT_REFS       0x00000002
 /* #define HINT_notused4       0x00000004 */
-#define HINT_UTF8              0x00000008
+#define HINT_BYTE              0x00000008
 /* #define HINT_notused10      0x00000010 */
                                /* Note: 20,40,80 used for NATIVE_HINTS */
 
@@ -2441,6 +2485,7 @@ enum {            /* pass one of these to get_vtbl */
 #define HINT_RE_EVAL           0x00200000
 
 #define HINT_FILETEST_ACCESS   0x00400000
+#define HINT_UTF8              0x00800000
 
 /* Various states of an input record separator SV (rs, nrs) */
 #define RsSNARF(sv)   (! SvOK(sv))
@@ -2959,16 +3004,29 @@ typedef struct am_table_short AMTS;
 
 #endif /* !USE_LOCALE_NUMERIC */
 
-#if defined(USE_LONG_LONG) && defined(HAS_LONG_LONG) && defined(HAS_ATOLL)
-#define Atol atoll 
-#else
-#define Atol atol
+#if !defined(Atol) && 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
+#   endif
+#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) && defined(HAS_STRTOULL)
-#define Strtoul strtoull
-#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)
@@ -3103,4 +3161,12 @@ typedef struct am_table_short AMTS;
 #include "patchlevel.h"
 #undef PERL_PATCHLEVEL_H_IMPLICIT
 
+/* Mention
+   
+   NV_PRESERVES_UV
+   HAS_ICONV
+   I_ICONV
+
+   so that Configure picks them up. */
+
 #endif /* Include guard */