Update Changes.
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index df90a65..2b66473 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1692,6 +1692,13 @@ typedef struct ptr_tbl PTR_TBL_t;
 #  define USE_ENVIRON_ARRAY
 #endif
 
+#ifdef JPL
+    /* E.g. JPL needs to operate on a copy of the real environment.
+     * JDK 1.2 and 1.3 seem to get upset if the original environment
+     * is diddled with. */
+#   define NEED_ENVIRON_DUP_FOR_MODIFY
+#endif
+
 #ifndef PERL_SYS_INIT3
 #  define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)
 #endif
@@ -2139,9 +2146,11 @@ Gid_t getegid (void);
 #  if defined(PERL_OBJECT)
 #    define DEBUG_m(a) if (PL_debug & 128)     a
 #  else
+     /* Temporarily turn off memory debugging in case the a
+      * does memory allocation, either directly or indirectly. */
 #    define DEBUG_m(a)  \
     STMT_START {                                                       \
-       if (PERL_GET_INTERP) { dTHX; if (PL_debug & 128) { a; } }       \
+        if (PERL_GET_INTERP) { dTHX; if (PL_debug & 128) {PL_debug&=~128; a; PL_debug|=128;} } \
     } STMT_END
 #  endif
 #define DEBUG_f(a) if (PL_debug & 256) a
@@ -2200,9 +2209,8 @@ struct ufuncs {
 /* In pre-5.7-Perls the 'U' magic didn't get the thread context.
  * XS code wanting to be backward compatible can do something
  * like the following:
+
 #ifndef PERL_MG_UFUNC
-/* the old way, without pTHX_ */
 #define PERL_MG_UFUNC(name,ix,sv) I32 name(IV ix, SV *sv)
 #endif
 
@@ -2216,7 +2224,9 @@ static PERL_MG_UFUNC(foo_get, index, val)
 
 */
 
+#ifndef PERL_MG_UFUNC
 #define PERL_MG_UFUNC(name,ix,sv) I32 name(pTHX_ IV ix, SV *sv)
+#endif
 
 /* Fix these up for __STDC__ */
 #ifndef DONT_DECLARE_STD
@@ -3322,8 +3332,12 @@ typedef struct am_table_short AMTS;
  * Remap printf
  */
 #undef printf
+#ifdef __GNUC__
+#define printf(fmt,args...) PerlIO_stdoutf(fmt,##args)
+#else
 #define printf PerlIO_stdoutf
 #endif
+#endif
 
 /* if these never got defined, they need defaults */
 #ifndef PERL_SET_CONTEXT