slurping an empty file should return '' rather than undef, with
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index a9c2268..0661558 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -8,7 +8,6 @@
  */
 #ifndef H_PERL
 #define H_PERL 1
-#define OVERLOAD
 
 #ifdef PERL_FOR_X2P
 /*
@@ -399,17 +398,16 @@ Malloc_t Perl_realloc _((Malloc_t where, MEM_SIZE nbytes));
 /* 'mfree' rather than 'free', since there is already a 'perl_free'
  * that causes clashes with case-insensitive linkers */
 Free_t   Perl_mfree _((Malloc_t where));
-#   endif
-
-#   undef safemalloc
-#   undef safecalloc
-#   undef saferealloc
-#   undef safefree
-#   define safemalloc  Perl_malloc
-#   define safecalloc  Perl_calloc
-#   define saferealloc Perl_realloc
-#   define safefree    Perl_mfree
 
+#  define safemalloc  Perl_malloc
+#  define safecalloc  Perl_calloc
+#  define saferealloc Perl_realloc
+#  define safefree    Perl_mfree
+#else  /* MYMALLOC */
+#  define safemalloc  safesysmalloc
+#  define safecalloc  safesyscalloc
+#  define saferealloc safesysrealloc
+#  define safefree    safesysfree
 #endif /* MYMALLOC */
 
 #if defined(STANDARD_C) && defined(I_STDDEF)
@@ -1489,8 +1487,19 @@ union any {
 #endif /* USE_THREADS */
 
 /* Work around some cygwin32 problems with importing global symbols */
-#if defined(CYGWIN32) && defined(DLLIMPORT) 
+#if defined(CYGWIN32)
+#  if defined(DLLIMPORT) 
 #   include "cw32imp.h"
+#  endif
+/* USEMYBINMODE
+ *   This symbol, if defined, indicates that the program should
+ *   use the routine my_binmode(FILE *fp, char iotype) to insure
+ *   that a file is in "binary" mode -- that is, that no translation
+ *   of bytes occurs on read or write operations.
+ */
+#  define USEMYBINMODE / **/
+#  define my_binmode(fp, iotype) \
+            (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? TRUE : NULL)
 #endif
 
 #include "regexp.h"
@@ -2485,12 +2494,10 @@ EXT MGVTBL PL_vtbl_collxfrm = {0,
                                        0,      0,      0};
 #endif
 
-#ifdef OVERLOAD
 EXT MGVTBL PL_vtbl_amagic =       {0,     magic_setamagic,
                                         0,      0,      magic_setamagic};
 EXT MGVTBL PL_vtbl_amagicelem =   {0,     magic_setamagic,
                                         0,      0,      magic_setamagic};
-#endif /* OVERLOAD */
 
 #else /* !DOINIT */
 
@@ -2529,15 +2536,11 @@ EXT MGVTBL PL_vtbl_regdatum;
 EXT MGVTBL PL_vtbl_collxfrm;
 #endif
 
-#ifdef OVERLOAD
 EXT MGVTBL PL_vtbl_amagic;
 EXT MGVTBL PL_vtbl_amagicelem;
-#endif /* OVERLOAD */
 
 #endif /* !DOINIT */
 
-#ifdef OVERLOAD
-
 enum {
   fallback_amg,        abs_amg,
   bool__amg,   nomethod_amg,
@@ -2672,8 +2675,6 @@ typedef struct am_table_short AMTS;
 #   endif
 #endif /* _FASTMATH */
 
-#endif /* OVERLOAD */
-
 #define PERLDB_ALL     0x3f            /* No _NONAME, _GOTO */
 #define PERLDBf_SUB    0x01            /* Debug sub enter/exit. */
 #define PERLDBf_LINE   0x02            /* Keep line #. */