[ID 20001025.011] [PATCH] t/io/open.t perl@7369[ 7350] breaks VMS perl
[p5sagit/p5-mst-13.2.git] / perlio.c
index 6945a75..969b8d1 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -9,7 +9,11 @@
 
 
 #define VOIDUSED 1
-#include "config.h"
+#ifdef PERL_MICRO
+#   include "uconfig.h"
+#else
+#   include "config.h"
+#endif
 
 #define PERLIO_NOT_STDIO 0 
 #if !defined(PERLIO_IS_STDIO) && !defined(USE_SFIO)
@@ -172,10 +176,14 @@ PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, int cnt)
 #else
   Perl_croak(aTHX_ "Cannot set 'ptr' of FILE * on this system");
 #endif
-#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
+#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE) && defined (STDIO_PTR_LVAL_NOCHANGE_CNT)
   FILE_cnt(f) = cnt;
 #else
-  Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system");
+#if defined(STDIO_PTR_LVAL_SETS_CNT)
+  assert (FILE_cnt(f) == cnt);
+#else
+  Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system when setting 'ptr'");
+#endif
 #endif
 }