Changes to allow compiler with gcc-2.8.1 in C++ mode,
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 686752c..9be3245 100644 (file)
--- a/perl.h
+++ b/perl.h
 #  ifdef __GNUC__
 #    define stringify_immed(s) #s
 #    define stringify(s) stringify_immed(s)
+#ifdef EMBED
+register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
+#else
 register struct op *op asm(stringify(OP_IN_REGISTER));
+#endif
 #  endif
 #endif
 
@@ -113,15 +117,10 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 # define STANDARD_C 1
 #endif
 
-#if defined(__cplusplus) || defined(WIN32) || defined(__sgi) || defined(OS2) \
-       || defined(__DGUX)
+#if defined(__cplusplus) || defined(WIN32) || defined(__sgi) || defined(OS2) || defined(__DGUX)
 # define DONT_DECLARE_STD 1
 #endif
 
-#if defined(NeXT) && !defined(_POSIX_SOURCE)
-#   define MISSING_PID_T
-#endif
-
 #if defined(HASVOLATILE) || defined(STANDARD_C)
 #   ifdef __cplusplus
 #      define VOL              // to temporarily suppress warnings
@@ -138,10 +137,6 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 #define TAINT_ENV()    if (tainting) { taint_env(); }
 #define TAINT_PROPER(s)        if (tainting) { taint_proper(no_security, s); }
 
-#ifdef MISSING_PID_T
-typedef int pid_t;
-#endif
-
 /* XXX All process group stuff is handled in pp_sys.c.  Should these 
    defines move there?  If so, I could simplify this a lot. --AD  9/96.
 */
@@ -792,7 +787,11 @@ Free_t   Perl_free _((Malloc_t where));
 #  ifdef MAXUSHORT
 #    define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
 #  else
-#    define PERL_USHORT_MAX       ((unsigned short)~(unsigned)0)
+#    ifdef USHRT_MAX
+#      define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
+#    else
+#      define PERL_USHORT_MAX       ((unsigned short)~(unsigned)0)
+#    endif
 #  endif
 #endif
 
@@ -802,7 +801,11 @@ Free_t   Perl_free _((Malloc_t where));
 #  ifdef MAXSHORT    /* Often used in <values.h> */
 #    define PERL_SHORT_MAX ((short)MAXSHORT)
 #  else
-#    define PERL_SHORT_MAX      ((short) (PERL_USHORT_MAX >> 1))
+#    ifdef SHRT_MAX
+#      define PERL_SHORT_MAX ((short)SHRT_MAX)
+#    else
+#      define PERL_SHORT_MAX      ((short) (PERL_USHORT_MAX >> 1))
+#    endif
 #  endif
 #endif
 
@@ -812,7 +815,11 @@ Free_t   Perl_free _((Malloc_t where));
 #  ifdef MINSHORT
 #    define PERL_SHORT_MIN ((short)MINSHORT)
 #  else
-#    define PERL_SHORT_MIN        (-PERL_SHORT_MAX - ((3 & -1) == 3))
+#    ifdef SHRT_MIN
+#      define PERL_SHORT_MIN ((short)SHRT_MIN)
+#    else
+#      define PERL_SHORT_MIN        (-PERL_SHORT_MAX - ((3 & -1) == 3))
+#    endif
 #  endif
 #endif
 
@@ -1108,6 +1115,8 @@ union any {
 #include "hv.h"
 #include "mg.h"
 #include "scope.h"
+#include "bytecode.h"
+#include "byterun.h"
 
 /* work around some libPW problems */
 #ifdef DOINIT
@@ -1636,6 +1645,12 @@ typedef enum {
 #define PERLVARI(var,type,init) type var;
 #define PERLVARIC(var,type,init) type var;
 
+/* Interpreter exitlist entry */
+typedef struct exitlistentry {
+    void (*fn) _((void*));
+    void *ptr;
+} PerlExitListEntry;
+
 #ifdef PERL_GLOBAL_STRUCT
 struct perl_vars {
 #include "perlvars.h"
@@ -2032,7 +2047,7 @@ enum {
 
 #endif /* !USE_LOCALE_NUMERIC */
 
-#if !defined(PERLIO_IS_STDIO) && defined(HAS_ATTRIBUTE)
+#if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)
 /* 
  * Now we have __attribute__ out of the way 
  * Remap printf 
@@ -2054,6 +2069,9 @@ enum {
            nice_chunk = (char*)(chunk);                \
            nice_chunk_size = (chunk_size);             \
        }                                               \
+       else {                                          \
+           Safefree(chunk);                            \
+       }                                               \
        UNLOCK_SV_MUTEX;                                \
     } while (0)