Encode 1.76 Released
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index d8147a9..d1b369d 100644 (file)
--- a/perl.h
+++ b/perl.h
 #include <sys/fcntl.h>
 #endif
 
+#ifdef VOIDUSED
+#   undef VOIDUSED
+#endif 
 #define VOIDUSED 1
+
 #ifdef PERL_MICRO
 #   include "uconfig.h"
 #else
 #  endif
 #endif
 
+/* undef WIN32 when building on Cygwin (for libwin32) - gph */
+#ifdef __CYGWIN__
+#   undef WIN32
+#   undef _WIN32
+#endif
+
 /* Use the reentrant APIs like localtime_r and getpwent_r */
 /* Win32 has naturally threadsafe libraries, no need to use any _r variants. */
 #if defined(USE_ITHREADS) && !defined(USE_REENTRANT_API) && !defined(NETWARE) && !defined(WIN32) && !defined(__APPLE__)
@@ -449,7 +459,7 @@ int usleep(unsigned int);
 #  define MYSWAP
 #endif
 
-/* Cannot include embed.h here on Win32 as win32.h has not
+/* Cannot include embed.h here on Win32 as win32.h has not 
    yet been included and defines some config variables e.g. HAVE_INTERP_INTERN
  */
 #if !defined(PERL_FOR_X2P) && !(defined(WIN32)||defined(VMS))
@@ -1231,6 +1241,11 @@ typedef NVTYPE NV;
 /* e.g. libsunmath doesn't have modfl and frexpl as of mid-March 2000 */
 #   ifdef HAS_MODFL
 #       define Perl_modf(x,y) modfl(x,y)
+/* eg glibc 2.2 series seems to provide modfl on ppc and arm, but has no
+   prototype in <math.h> */
+#       ifndef HAS_MODFL_PROTO
+long double modfl(long double, long double *);
+#      endif
 #   else
 #       define Perl_modf(x,y) ((long double)modf((double)(x),(double*)(y)))
 #   endif
@@ -2386,6 +2401,7 @@ Gid_t getegid (void);
 
 #ifndef Perl_error_log
 #  define Perl_error_log       (PL_stderrgv                    \
+                                && isGV(PL_stderrgv)           \
                                 && GvIOp(PL_stderrgv)          \
                                 && IoOFP(GvIOp(PL_stderrgv))   \
                                 ? IoOFP(GvIOp(PL_stderrgv))    \
@@ -2413,7 +2429,9 @@ Gid_t getegid (void);
 #define DEBUG_T_FLAG           0x00020000 /* 131072 */
 #define DEBUG_R_FLAG           0x00040000 /* 262144 */
 #define DEBUG_J_FLAG           0x00080000 /* 524288 */
-#define DEBUG_MASK             0x000FFFFF /* mask of all the standard flags */
+#define DEBUG_v_FLAG           0x00100000 /*1048576 */
+#define DEBUG_C_FLAG           0x00200000 /*2097152 */
+#define DEBUG_MASK             0x003FFFFF /* mask of all the standard flags */
 
 #define DEBUG_DB_RECURSE_FLAG  0x40000000
 #define DEBUG_TOP_FLAG         0x80000000 /* XXX what's this for ??? Signal
@@ -2439,6 +2457,8 @@ Gid_t getegid (void);
 #  define DEBUG_T_TEST_ (PL_debug & DEBUG_T_FLAG)
 #  define DEBUG_R_TEST_ (PL_debug & DEBUG_R_FLAG)
 #  define DEBUG_J_TEST_ (PL_debug & DEBUG_J_FLAG)
+#  define DEBUG_v_TEST_ (PL_debug & DEBUG_v_FLAG)
+#  define DEBUG_C_TEST_ (PL_debug & DEBUG_C_FLAG)
 
 #ifdef DEBUGGING
 
@@ -2465,6 +2485,8 @@ Gid_t getegid (void);
 #  define DEBUG_T_TEST DEBUG_T_TEST_
 #  define DEBUG_R_TEST DEBUG_R_TEST_
 #  define DEBUG_J_TEST DEBUG_J_TEST_
+#  define DEBUG_v_TEST DEBUG_v_TEST_
+#  define DEBUG_C_TEST DEBUG_C_TEST_
 
 #  define DEB(a)     a
 #  define DEBUG(a)   if (PL_debug)   a
@@ -2505,6 +2527,8 @@ Gid_t getegid (void);
 
 #  define DEBUG_T(a) DEBUG__(DEBUG_T_TEST, a)
 #  define DEBUG_R(a) DEBUG__(DEBUG_R_TEST, a)
+#  define DEBUG_v(a) DEBUG__(DEBUG_v_TEST, a)
+#  define DEBUG_C(a) DEBUG__(DEBUG_C_TEST, a)
 
 #else /* DEBUGGING */
 
@@ -2528,6 +2552,8 @@ Gid_t getegid (void);
 #  define DEBUG_T_TEST (0)
 #  define DEBUG_R_TEST (0)
 #  define DEBUG_J_TEST (0)
+#  define DEBUG_v_TEST (0)
+#  define DEBUG_C_TEST (0)
 
 #  define DEB(a)
 #  define DEBUG(a)
@@ -2550,6 +2576,8 @@ Gid_t getegid (void);
 #  define DEBUG_S(a)
 #  define DEBUG_T(a)
 #  define DEBUG_R(a)
+#  define DEBUG_v(a)
+#  define DEBUG_C(a)
 #endif /* DEBUGGING */
 
 
@@ -2592,6 +2620,7 @@ Gid_t getegid (void);
 #define PERL_MAGIC_uvar                  'U' /* Available for use by extensions */
 #define PERL_MAGIC_uvar_elem     'u' /* Reserved for use by extensions */
 #define PERL_MAGIC_vec           'v' /* vec() lvalue */
+#define PERL_MAGIC_vstring       'V' /* SV was vstring literal */
 #define PERL_MAGIC_substr        'x' /* substr() lvalue */
 #define PERL_MAGIC_defelem       'y' /* Shadow "foreach" iterator variable /
                                        smart parameter vivification */
@@ -3149,7 +3178,8 @@ typedef enum {
     XBLOCK,
     XATTRBLOCK,
     XATTRTERM,
-    XTERMBLOCK
+    XTERMBLOCK,
+    XTERMORDORDOR /* evil hack */
 } expectation;
 
 enum {         /* pass one of these to get_vtbl */
@@ -3822,9 +3852,8 @@ typedef struct am_table_short AMTS;
 #   define Atoul(s)    Strtoul(s, (char **)NULL, 10)
 #endif
 
-#if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)
+#if !defined(PERLIO_IS_STDIO)
 /*
- * Now we have __attribute__ out of the way
  * Remap printf
  */
 #undef printf