Make Power MachTen use vfork and perl's malloc
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 60f7dd5..7f3fd63 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -90,8 +90,8 @@ are local to a function.
 PERL HOST
 1. The perl host is linked with perlX.lib to get perl_alloc. This
 function will return a pointer to CPerlObj (the PERL_OBJECT). It
-takes pointers to the various PerlXXX_YYY interfaces (see ipdir.h for
-information on this).
+takes pointers to the various PerlXXX_YYY interfaces (see iperlsys.h
+for more information on this).
 2. The perl host calls the same functions as normally would be
 called in setting up and running a perl script, except that the
 functions are now member functions of the PERL_OBJECT.
@@ -312,13 +312,7 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 #  endif
 #endif
 
-#include "perlio.h"
-#include "perlmem.h"
-#include "perllio.h"
-#include "perlsock.h"
-#include "perlproc.h"
-#include "perlenv.h"
-#include "perldir.h"
+#include "iperlsys.h"
 
 #ifdef USE_NEXT_CTYPE
 
@@ -379,7 +373,7 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
 #   ifdef HIDEMYMALLOC
 #      define malloc  Mymalloc
 #      define calloc  Mycalloc
-#      define realloc Myremalloc
+#      define realloc Myrealloc
 #      define free    Myfree
 Malloc_t Mymalloc _((MEM_SIZE nbytes));
 Malloc_t Mycalloc _((MEM_SIZE elements, MEM_SIZE size));
@@ -390,11 +384,21 @@ Free_t   Myfree _((Malloc_t where));
 #      define malloc  Perl_malloc
 #      define calloc  Perl_calloc
 #      define realloc Perl_realloc
+/* VMS' external symbols are case-insensitive, and there's already a */
+/* perl_free in perl.h */
+#ifdef VMS
+#      define free    Perl_myfree
+#else
 #      define free    Perl_free
+#endif
 Malloc_t Perl_malloc _((MEM_SIZE nbytes));
 Malloc_t Perl_calloc _((MEM_SIZE elements, MEM_SIZE size));
 Malloc_t Perl_realloc _((Malloc_t where, MEM_SIZE nbytes));
+#ifdef VMS
+Free_t   Perl_myfree _((Malloc_t where));
+#else
 Free_t   Perl_free _((Malloc_t where));
+#endif
 #   endif
 
 #   undef safemalloc
@@ -559,12 +563,6 @@ Free_t   Perl_free _((Malloc_t where));
 #   undef HAS_STRERROR
 #endif
 
-#ifndef HAS_MKFIFO
-#  ifndef mkfifo
-#    define mkfifo(path, mode) (mknod((path), (mode) | S_IFIFO, 0))
-#  endif
-#endif /* !HAS_MKFIFO */
-
 #include <errno.h>
 #ifdef HAS_SOCKET
 #   ifdef I_NET_ERRNO
@@ -1117,6 +1115,10 @@ typedef I32 (*filter_t) _((int, SV *, int));
  */
 
 #ifdef USE_THREADS
+   /* pending resolution of licensing issues, we avoid the erstwhile
+    * atomic.h everywhere */
+#  define EMULATE_ATOMIC_REFCOUNTS
+
 #  ifdef FAKE_THREADS
 #    include "fakethr.h"
 #  else
@@ -1207,17 +1209,17 @@ typedef pthread_key_t perl_key;
 #   endif
 #endif
 
+#ifdef UNION_ANY_DEFINITION
+UNION_ANY_DEFINITION;
+#else
 union any {
     void*      any_ptr;
     I32                any_i32;
     IV         any_iv;
     long       any_long;
     void       (CPERLscope(*any_dptr)) _((void*));
-#if defined(WIN32) && !defined(PERL_OBJECT)
-       /* Visual C thinks that a pointer to a member variable is 16 bytes in size. */
-       char    handle_VC_problem[16];
-#endif
 };
+#endif
 
 #ifdef USE_THREADS
 #define ARGSproto struct perl_thread *thr
@@ -1814,6 +1816,15 @@ typedef enum {
 #define HINT_STRICT_VARS       0x00000400
 #define HINT_LOCALE            0x00000800
 
+#define HINT_NEW_INTEGER       0x00001000
+#define HINT_NEW_FLOAT         0x00002000
+#define HINT_NEW_BINARY                0x00004000
+#define HINT_NEW_STRING                0x00008000
+#define HINT_NEW_RE            0x00010000
+#define HINT_LOCALIZE_HH       0x00020000 /* %^H needs to be copied */
+
+#define HINT_RE_TAINT          0x00100000
+
 /* Various states of an input record separator SV (rs, nrs) */
 #define RsSNARF(sv)   (! SvOK(sv))
 #define RsSIMPLE(sv)  (SvOK(sv) && SvCUR(sv))
@@ -1942,11 +1953,11 @@ typedef void *Thread;
 
 #ifndef MULTIPLICITY
 
-#ifndef USE_THREADS
-#include "thrdvar.h"
-#endif
+#  include "intrpvar.h"
+#  ifndef USE_THREADS
+#    include "thrdvar.h"
+#  endif
 
-#include "intrpvar.h"
 #endif
 
 #ifdef PERL_OBJECT
@@ -2041,7 +2052,7 @@ EXT MGVTBL vtbl_mutex =   {0,     0,      0,      0,      magic_mutexfree};
 EXT MGVTBL vtbl_defelem = {magic_getdefelem,magic_setdefelem,
                                        0,      0,      magic_freedefelem};
 
-EXT MGVTBL vtbl_regexp = {0,magic_unchain,0,0, magic_freeregexp};
+EXT MGVTBL vtbl_regexp = {0,0,0,0, magic_freeregexp};
 
 #ifdef USE_LOCALE_COLLATE
 EXT MGVTBL vtbl_collxfrm = {0,