up patchlevel &c
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 14e891c..f075f3a 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -502,6 +502,12 @@ Free_t   Perl_mfree _((Malloc_t where));
 #   endif
 #endif
 
+#ifndef memchr
+#   ifndef HAS_MEMCHR
+#       define memchr(s,c,n) ninstr((char*)(s), ((char*)(s)) + n, &(c), &(c) + 1)
+#   endif
+#endif
+
 #ifndef HAS_BCMP
 #   ifndef bcmp
 #      define bcmp(s1,s2,l) memcmp(s1,s2,l)
@@ -1455,7 +1461,15 @@ typedef pthread_key_t    perl_key;
  * XXX the default needs a Configure test, as it may not work everywhere.
  */
 #ifndef PERL_FLUSHALL_FOR_CHILD
-#define PERL_FLUSHALL_FOR_CHILD        PerlIO_flush((PerlIO*)NULL)
+# if defined(FFLUSH_NULL) || defined(USE_SFIO)
+#  define PERL_FLUSHALL_FOR_CHILD      PerlIO_flush((PerlIO*)NULL)
+# else
+#  ifdef FFLUSH_ALL
+#   define PERL_FLUSHALL_FOR_CHILD     my_fflush_all()
+#  else
+#   define PERL_FLUSHALL_FOR_CHILD     (void)0
+#  endif
+# endif
 #endif
 
 /* Some unistd.h's give a prototype for pause() even though
@@ -1903,12 +1917,13 @@ EXT char *** environ_pointer;
 #  endif
 #else
    /* VMS and some other platforms don't use the environ array */
-#  if !defined(VMS) || \
-      !defined(DONT_DECLARE_STD) || \
-      (defined(__svr4__) && defined(__GNUC__) && defined(sun)) || \
-      defined(__sgi) || \
-      defined(__DGUX)
+#  if !defined(VMS)
+#    if !defined(DONT_DECLARE_STD) || \
+        (defined(__svr4__) && defined(__GNUC__) && defined(sun)) || \
+        defined(__sgi) || \
+        defined(__DGUX)
 extern char ** environ;        /* environment variables supplied via exec */
+#    endif
 #  endif
 #endif
 
@@ -2423,7 +2438,7 @@ PERLVAR(object_compatibility[30], char)
 #undef PERLVARI
 #undef PERLVARIC
 
-#if defined(HASATTRIBUTE) && defined(WIN32)
+#if defined(HASATTRIBUTE) && defined(WIN32) && !defined(CYGWIN32)
 /*
  * This provides a layer of functions and macros to ensure extensions will
  * get to use the same RTL functions as the core.